Re: git branch command is incompatible with bash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 28, 2015, 15:23 UTC
- Message-ID
- <xmqq4mkogvb7.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <55B72F09.3030000@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
> Are you trying to say that the result of 'rev-parse --abbrev-ref HEAD' > is suboptimal and that of 'symbolic-ref --short HEAD' is OK?
My "Interesting" was primarily about that I wasn't aware of the "--abbrev-ref" option.
Yes, I am sure some time ago I accepted a patch to add it, but I simply do not see the point, especially because the "--short" option to symbolic-ref feels much more superiour. "What branch am I on?" is about symbolic refs, rev-parse is about revisions.
I can see that "symbolic-ref --short" is much newer than the other one, so addition of "--abbrev-ref" to "rev-parse" may have been a mistake made while being desperate (i.e. not having a way to do so with plumbing, we wanted "some" way to do so and chose poorly).