How to find a revision's branch name
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Mar 18, 2006, 06:02 UTC
- Message-ID
- <e5bfff550603172202ia4b69f2he5562b826e491426@mail.gmail.com>
In today git archive, todo branch.
$ git-rev-list -n1 --header b14e2494b8a70737066f4ade4df1b5559e81b44b b14e2494b8a70737066f4ade4df1b5559e81b44b tree 1baa1f8405d1fef90fe95f2477133a69adec288b parent 8158d510c641e2354cf24a10bc3e994c7a1e3125 author Junio C Hamano <junkio@cox.net> 1137562948 -0800 committer Junio C Hamano <junkio@cox.net> 1137562948 -0800
TODO updates 2006-01-17.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Is it possible to get branch name from a revision sha? Something like
$ git branch b14e2494b8a70737066f4ade4df1b5559e81b44b todo
I need this to correctly annotate files not in HEAD tree. Currently qgit runs git-rev-list --header --topo-order --parents --remove-empty HEAD -- <path>
to get a file history. But this fails if <path> is not found in HEAD. The right command to run in our case should be: git-rev-list --header --topo-order --parents --remove-empty todo -- <path>
So I need to get 'todo' branch name from a given revision sha's.
BTW also git blame fails (gracefully) if revision is not in HEAD:
$ git blame b14e2494b8a70737066f4ade4df1b5559e81b44b b14e2494b8a70737066f4ade4df1b5559e81b44b not found in HEAD
Thanks Marco