Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 10, 2009, 00:24 UTC
- Message-ID
- <7viqnjrveb.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20090210000321.78025483@crow>
Mark Burton <markb@ordern.com> writes:
Show 8 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: >> Let's hope that nobody's scripts rely on a single star in front of the >> local HEAD... > > I don't know if I have any scripts that rely on a single star in front of > the local HEAD or not (I'm sure some people must have them), but I do > think this new feature would be very confusing, especially when used > with -a.
People use "git branch | sed -ne 's/^\* //p' in their scripts (you can say "against recommendation" but I think it is a sign that the recommendation against use of Porcelain in the scripts is not loud enough). I do not think anybody greps in "git branch -a", though, for that purpose.
The current "branch -a" output is a mess. It omits "remotes/" even though it includes the local ones in the output. Perhaps with remotes/, the output may become a bit more readable:
$ git branch -a
* master
next
pu
* remotes/dscho/master
* remotes/origin/master
remotes/origin/next
remotes/origin/pu
* remotes/spearce/masterwhich may still be too loud with asterisks, but at least there is no confusion. Or perhaps like this:
$ git branch -a
* master
next
pu
remotes/dscho/HEAD -> master
remotes/dscho/master
remotes/origin/HEAD -> master
remotes/origin/master
remotes/origin/next
remotes/origin/pu
remotes/spearce/HEAD -> master
remotes/spearce/masterwith an obvious twist when there is no mixed output:
$ git branch -r
dscho/HEAD -> master
dscho/master
origin/HEAD -> master
origin/master
origin/next
origin/pu
spearce/HEAD -> master
spearce/master