Closed CaptainQuirk closed 5 years ago
Could you elaborate? Do you simply want to see the last tag that was created? Or the closest tag to HEAD (the checked out branch)? Or do you want to display a tag in stead of the short commit hash when in detached HEAD mode? Something else?
The closest tag to HEAD would be great !
Can you describe why you want this? What is "the problem" you're trying to solve by being able to see that tag?
Ps: I'm not trying to push this request away, but I'm simply trying to determine if this is worth the work for a broader set of users, and if so, what the best way to implement it is ;)
@jaspernbrouwer, I'm not trying to solve any problem in particular, just to know what is the most recent tag that was set relative to my current HEAD.
For example, I find it useful to use annotated tags to tag some code I put in production and this segment would basically display the tag corresponding to this last deployment (or for example to a preproduction environment with tags containing the string rc).
Knowing what to put as git show <tag>
would then be easier !
Thanks for the explanation, I'll see what I can do!
From my experience (I used to use some bash prompt modifier found here https://github.com/mgedmin/dotfiles/blob/master/bashrc.prompt) it is quite useful to have indication of a tag name if you're exactly on that tag.
Otherwise if I checkout tag I see something a bit useless:
~ > git > linux > afd2ff9: git status
HEAD detached at v4.4
nothing to commit, working directory clean
Done! Finally 😁
Please update using pip install --upgrade powerline-gitstatus
, don't forget to add the highlight group gitstatus_tag
to your colorscheme.
Well I'd say this feature is sort of half-cooked now :( Now if "show_tag" is enabled last tag in the current branch will be displayed always. For example I may have 100500 commits on top of the last tag and still last tag name will be displayed. Which is not very useful and moreover could be a bit misleading.
What I really meant was to display tag name only if we're on a pristine tag. Moreover if that's the case revision hash should be concealed (because who cares if we're already on very good identified commit).
This enhancement IMHO could be implemented quite simple:
git describe --tags --abbrev=0
git rev-parse MY_TAG
git rev-parse HEAD
Any thoughts?
Indeed I may try to implement that myself but having very limited experience in Perl I may think more experienced person could be much faster with that hopefully pretty simple improvement :)
This sounds like there's demand for several features:
As both these options need an extra git call, I want to keep them disabled by default. But I guess I could split them out in several arguments (replace_hash_with_tag
and show_most_recent_tag
).
I'm happy to look into into your proposition, just wanted to point out this is a different use-case.
PS: It's all Python by the way 😄
Makes perfect sense. But frankly being so egocentric I didn't realize @CaptainQuirk wanted last tag always to be displayed. Just because I don't really see a use-case for that. Probably it worth getting opinion of @CaptainQuirk on that topic so we're not just guessing.
I agree with @abrodkin as it is this feature is very misleading. Any progress on this feature requet?
I think v1.3.0 fixes the issues raised in this thread. If not, please open a new issue!
@jcharaoui I don't see either release or tag 1.3.0 are you referring to the current master branch?
Sorry, I'm new here! Simply forgot to push tags. Did a release for v1.3.1 on GitHub and PyPI.
Hi there !
Thanks for your work !
Would you consider adding a segment that exposes the last git tag ?