Closed antis81 closed 9 years ago
Did I make wrong naming decisions when I wrote the reference name analyser or did you confuse the concept of namespaces with scopes? Or maybe both? Will check that :)
I remember we had once a really big discussion about this ... :). In general the names "namespace" and "scope" are historical. At the time I wrote the RefItem
code, I didn't know about the namespacing mechanism in Git - the world was simple :).
In the MGV-Module RefsViews
we currently have two classes relevant to this topic:
RefScope
RefNamespace
As Git::RefName
uses similar names, these names became ambiguous and cannot be translated 1:1.
Another problem: Both classes are technically 100% identical. They just serve different appearance purposes (display roles). I'll leave this fact aside and go straight forward to get the names clear once and for all.
Let's rename the classes to their meaning:
HeaderItem
FolderItem
Now it is more clear:
Both classes have nothing in common with a "scope" or "namespace" from Git::RefName
! Actually a FolderItem can contain one of both.
Let's further simplify it:
The HeaderItem
has a static name and groups references of the same type. So, for this topic, we don't need that and only talk about the FolderItem
, which is built out of the reference shorthand path
.
Here I had two problems:
When I understand Git::RefName::scopes()
right, this list should be the separated shorthand path without the reference name. Seems like this is not implemented though and Git::RefName::scopes()
is always empty. @scunz Could you check that, please?
Now why did I do the Git::RefName::namespaces()
thing? Simple, because Git::RefName::shorthand()
gives me an empty list, if Git::RefName::isNamespaced() == true
.
Hope this "explanation" helps. Actually I plan to at least rename the RefItem
classes here to remove the ubiquitous confusion with those names.
Let me have my try with this code. I've actually refactored a lot already.
I'll close this PR, as the implementation in #99 has quite some advantages compared to this. The idea is pretty much the same and I don't want to produce just work :).
The member
RefBranch->mRef
was aGit::Reference
before. This is replaced now completely with a simple pointer to the validRM::Ref
. To avoid confusion I renamed the member tomRefInfo
.Known Bugs, that should be fixed, before the this PR is merged:
Rename-Dialog
is initialized with the "pure" reference name, which is is wrong!Here's a visual example, of how that currently looks: