Hi,
On Sun, Jan 4, 2009 at 2:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
You'll find hereafter two patches which implements this in
git-symbolic-ref and git-rev-parse. Feel free to choose the one you
find the best. If you choose to integrate one of these, tells me and
I'll do a proper documentation bits and patch submission.
Sample output:
~/git/% ./git-rev-parse --symbolic-short-name HEAD
master
~/git/% ./git-symbolic-ref -a HEAD
master
~/git/% git checkout v1.6.1
~/git/% ./git-rev-parse --symbolic-short-name HEAD
HEAD
~/git/% ./git-symbolic-ref -a HEAD
fatal: ref HEAD is not a symbolic ref
~/git/% ./git-symbolic-ref -qa HEAD
~/git/%
Thanks in advance,
- Arnaud
ps: I choose --symbolic-short-name as the opposite of
--symbolic-full-name for consistency.
ps2: sorry for the bogus mime-type