Skip to content
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

Setting to hide tags with detached history #178

Closed
chulkilee opened this issue Sep 11, 2019 · 4 comments
Closed

Setting to hide tags with detached history #178

chulkilee opened this issue Sep 11, 2019 · 4 comments
Assignees
Labels
feature request Feature request
Milestone

Comments

@chulkilee
Copy link

Currently it always shows all (e.g. remote) tags in the graph. It could be confusing if 1) there are many CI/CD tags which are not relevant to actual local dev and 2) there are multiple origins with own tags (e.g. working with multiple forks)

As the first step of improving tag handling.. what about adding an option to hide all remote tags?

@chulkilee chulkilee added the feature request Feature request label Sep 11, 2019
@mhutchie
Copy link
Owner

In Git repositories there is no distinction between local and remote tags (unlike branches with refs/heads/ & refs/remotes/). As soon as you fetch from a remote, the tags that are on the remote are added to the local repository under refs/tags/. For the same reason, there is no way to identify which remote a tag has come from.

Although distinguishing remote tags would be ideal, there just isn’t an efficient way to get the required information (because it is lost when tags on remotes are fetched and added to the local repo). For this reason, no other Git tool that I’m aware of does this.

Have you had a look at the Reference Label Alignment setting? It allows tags to be moved to the right of the description column, moving them out of the way of branches. This might benefit your repositories if you have a lot of tags of little interest to you.

@chulkilee
Copy link
Author

Thanks for the clarification on git tag! 🤦‍♂

However, the thing is that in my case I have many tags with detached history - so I just want to hide them.

* a55 (origin/develop, develop)
| * dd9 (tag: ci-whatever-tag)
| * ada
| * 2bd
| * d55
|/
* 018

I'd like to see the tree as following command:

git log --pretty=format:"%h %d %s %an" --decorate --graph --branches="*"

May I edit the title to "option to hide tags" and reopen this issue?

@mhutchie
Copy link
Owner

mhutchie commented Sep 11, 2019

I see, thanks for the clarification of your use case and requirements!

Currently git log ... --branches --tags --remotes HEAD -- is run to get the commits for display. I'll add a Git Graph Extension Setting that controls whether the --tag argument is included. This will prevent tags with detached history from appearing in Git Graph.

@mhutchie mhutchie reopened this Sep 11, 2019
@mhutchie mhutchie changed the title Option to hide remote tags Setting to hide tags with detached history Sep 11, 2019
mhutchie added a commit that referenced this issue Sep 12, 2019
…whether commits that are only referenced by tags should be shown in Git Graph.
@mhutchie mhutchie added this to the v1.15.0 milestone Sep 12, 2019
@mhutchie
Copy link
Owner

mhutchie commented Sep 12, 2019

This will be available in v1.15.0, which will be released in less than one day.

The new setting is called git-graph.showCommitsOnlyReferencedByTags (enabled by default). It controls whether the --tag argument is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants