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

Show tags #40

Open
johanhelsing opened this issue Jan 18, 2019 · 4 comments
Open

Show tags #40

johanhelsing opened this issue Jan 18, 2019 · 4 comments

Comments

@johanhelsing
Copy link

It would be nice if it was possible to see what tag(s) I had checked out, i.e. when doing:

git checkout v1.0.0

I would like to see v1.0.0 somewhere in the prompt.

@TomasTomecek
Copy link
Owner

This is a good suggestion. Sadly, this is a limitation of git: tags are not branches, so git treats them as a detached state. I feel like this could be doable, it would just require some tinkering with libgit.

@johanhelsing
Copy link
Author

I think fish's built in git prompt does this, maybe look there for how they do it?

@johanhelsing
Copy link
Author

Fish seems to use: git describe --tags --exact-match HEAD

@TomasTomecek
Copy link
Owner

Yup, that seems to work. The problem is that this tool is using libgit, so I would need to figure that out using the rust binding.

Right now p-g-p has like 5 methods to deal with branches and refs:

https://github.com/TomasTomecek/pretty-git-prompt/blob/master/src/backend.rs#L129

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

No branches or pull requests

2 participants