Re: git branch command is incompatible with bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 28, 2015 at 08:23:40AM -0700, Junio C Hamano wrote:
> Johannes Sixt <j6t@xxxxxxxx> 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.

Sometimes my question is "what branch am I on?" -- in which case
symbolic-ref is adequate.

Other times, my question is "where am I/what did I check out?" which is
usually a branch, sometimes a tag, and sometimes a commit hash.  We
don't have a one-stop-shop command to answer that question in all cases,
which is unfortunate.

git status answers, but that's not plumbing.  git-prompt manages to do a
fairly good job, but the logic is by no means straightforward.

-- 
Scott Schmit
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]