Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed

Conversation

Copy link
Contributor

@goran-w goran-w commented May 12, 2025

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 the TextBlock 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.

Copy link
Collaborator

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:

tags.Add(new Models.Tag()
{
Name = subs[0].Substring(10),
SHA = string.IsNullOrEmpty(subs[2]) ? subs[1] : subs[2],
CreatorDate = ulong.Parse(subs[3]),
Message = string.IsNullOrEmpty(message) ? null : message,
});

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).

Copy link
Contributor Author

goran-w commented May 13, 2025

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.
@goran-w goran-w force-pushed the separate_icon_for_annotated_tag branch from 6a5e6d1 to 47fa073 Compare May 13, 2025 04:07
Copy link
Collaborator

Done.

goran-w reacted with hooray emoji goran-w reacted with heart emoji

@goran-w goran-w deleted the separate_icon_for_annotated_tag branch May 13, 2025 04:39
Copy link
Contributor Author

goran-w commented May 13, 2025

Thanks, @love-linger - looks great! Just a note: the "annotated" string will need to be localized...

Copy link
Contributor Author

goran-w commented May 13, 2025

Also, maybe omit the duplicated tag-name (on the message line) for a lightweight tag, if the commit-message is actually empty?
image

Copy link
Collaborator

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?

Copy link
Contributor Author

goran-w commented May 13, 2025
edited
Loading

Can you test the output of git command in QueryTags for the empty-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...

Copy link
Contributor Author

goran-w commented May 13, 2025
edited
Loading

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /