-
Notifications
You must be signed in to change notification settings - Fork 274
Separate icon for annotated tag (to distinguish from lightweight tag) #1305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate icon for annotated tag (to distinguish from lightweight tag) #1305
Conversation
The commit 6a5e6d1 has been cherry-picked.
Regarding the icons for tags, I've decided to keep them consistent. Whether a tag is annotated
or lightweight
, its functionality remains unaffected.
Also, when retrieving the tag list, for annotated
tags, we always prefer to point the SHA
property to the referenced commit rather than the tag's own object. See line 35 of the code:
sourcegit/src/Commands/QueryTags.cs
Lines 32 to 38 in 01625ad
What SourceGit
needs to do is to correctly display the tag's message and, upon click, correctly locate the referenced commit.
Most other git clients do not distinguish between these two types of tags either. Introducing different tag icons actually increases the user's cognitive cost (in fact, there's no place to inform users why there are two types of icons).
I see. Could we PLEASE then instead indicate, only in the tag-message tooltip itself, by an icon and/or by a prefix text like "[Annotated:]" and "[Log:]" (or similar) respectively, where the message comes from?
The new icon is applied everywhere - except for Models.Decorator and Models.Filter, since these are not (yet) updated to discern the specific tag type.
6a5e6d1
to
47fa073
Compare
Thanks, @love-linger - looks great! Just a note: the "annotated" string will need to be localized...
Also, maybe omit the duplicated tag-name (on the message line) for a lightweight tag, if the commit-message is actually empty?
image
Also, maybe omit the duplicated tag-name (on the message line) for a lightweight tag, if the commit-message is actually empty?
Can you test the output of git command in QueryTags
for the empty-commit
?
Can you test the output of git command in
QueryTags
for theempty-commit
?
Ah, Git itself seems to respond with the tag-name if the (lightweight) commit-message is empty, and even when the (annotated) tag-message is empty!
Thus, to avoid the duplication we would need to compare the stripped message to the (isolated) tag-name and clear the message if they are identical...
Thank you, it now works like a charm!
And just for the record - my test result above was half wrong, but the fix is relevant nonetheless:
For a lightweight tag, an empty commit-message is returned as-is (empty) by Git.
(But for an annotated tag without a tag-message, Git will indeed return the tag-name, as I reported.)
The QueryTags command now additionally reads the %(objecttype) field, which allows us to distinguish between Lightweight tags and Annotated tags.
A new icon is applied for Annotated tags, almost everywhere - except for Models.Decorator and Models.Filter, since these are not (yet) updated to discern the specific tag type. Nevertheless, this change makes it much easier to distinguish if a tag is Annotated or Lightweight.
Also, it's now easier to understand if the tooltip tag-message comes from the (Annotated) tag itself or from the (Lightweight) tag's corresponding commit.
Finally, a
Border
is added around theTextBlock
of items in the TAGS list, to make its message-tooltip work more similar to the ref-tooltip in the LOCAL BRANCHES and REMOTES lists.