git-aware-prompt icon indicating copy to clipboard operation
git-aware-prompt copied to clipboard

Tag names

Open jordi-adell opened this issue 8 years ago • 6 comments

I added this code to get tag names in case you checkout a specific tag. Instead of just writing detached* as branch name.

You might want to include it the your main repo. I did not tested it extensively, but I will be actively using this fix from now on and will maintain it if necessary.

jordi-adell avatar Oct 16 '15 10:10 jordi-adell

I have been using this patch for months now, with several repositories, several machines, and a variety of versions of Ubuntu and Debian. No bug found, yet.

jordi-adell avatar Mar 29 '16 19:03 jordi-adell

Cool, I'll try to have a proper look at this week and merge it in :)

jimeh avatar Mar 29 '16 22:03 jimeh

Thanks jordi, I have been using your code since November and I like it!

But there is one situation where it looks odd: during a rebase. To reproduce:

  • Be safe: git checkout -b testing123
  • Do git rebase -i HEAD~~
  • Change one of the picks to edit, save and quit
  • See the prompt telling you that you are now on branch "undefined"!

With this simple fix I changed the undefined back into *detached during a rebase. You are both welcome to use that if you like.

I did also add some lines which detect and display when we are rebasing or merging, but they will be trapped in the office until next Monday. ;)

joeytwiddle avatar Apr 01 '16 15:04 joeytwiddle

Here is how to detect when we are stuck on a rebase, a merge, or a cherry-pick: https://github.com/joeytwiddle/git-aware-prompt/commit/1c87a4bb474e7b10bec3f8d6605761237b94d998

joeytwiddle avatar Apr 04 '16 07:04 joeytwiddle

@joeytwiddle Very nice :)...

I'll be spending some time on a proper update for git-aware-prompt soon. I personally haven't used the project since about 5 years ago when I switched to zsh. So the goal is to incorporate a lot of these kind of improvements, and make it compatible with both bash and zsh, so I can start using it myself again too.

jimeh avatar Apr 04 '16 08:04 jimeh

@joeytwiddle Good to know that the patch was useful.

jordi-adell avatar Jun 08 '16 14:06 jordi-adell