Thread (5 messages) flat view 5 messages, 3 authors, 2016-09-21

v2.9.3 and v2.10.0: `name-ref' HEAD gives wrong branch name

From: Steffen Nurpmeso <hidden>
Date: 2016-09-20 16:29:07

Hello again,

yah, sorry, i'm back again..
I try to find a way to find the name of the current branch in an
automated way, because i need to ensure that a commit happens on
it and no other branch.  Now the problem arises that the commit
ref at the time of that commit maybe shared in between several
different branches, but no more thereafter, of course:

  ?0[steffen@wales ]$ git branch|grep '^*'
  * stable/v14.9
  ?0[steffen@wales ]$ git name-rev --name-only HEAD
  stable/v14.8

Is there another way except looking into .git/HEAD or using sed(1)
on the output of `branch' to find the right name?
Thank you.
Ciao!

--steffen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help