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
Tag support for detached branche in git_prompt_info #5304
base: master
Are you sure you want to change the base?
Conversation
Thanks @jtyr for this, I'd like to see some performance comparisons since it adds another lookup to the prompt info. Could you do a before/after comparison? (or can we find a volunteer?) |
The performance depends on the state of the branch. If the HEAD is a ref (e.g. Here is a simple performance assessment:
All the commands are pretty fast and their execution is almost negligible. |
If the HEAD is not a symbolic ref (e.g. refs/heads/master) but it points to a commit ID (branch is detached), the git_prompt_info shows commit ID even if the commit ID points has a tag. This patch allows to display the tag version if there is a tag for the HEAD commit ID.
@robbyrussell Can I help with anything else to make this merged? |
@robbyrussell Please could you review this? |
This could probably be closed since gitfast plugin implements this feature. |
If the HEAD is not a symbolic ref (e.g. refs/heads/master) but it points to a commit ID (branch is detached), the git_prompt_info shows commit ID even if the commit ID points has a tag. This patch allows to display the tag version if there is a tag for the HEAD commit ID.