git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk

From
SBSanti Béjar <santi@agolina.net>
Date
Feb 10, 2009, 07:59 UTC
Message-ID
<adf1fd3d0902092359o43427e89j2005e3653766723f@mail.gmail.com>
In-Reply-To
<7viqnjrveb.fsf@gitster.siamese.dyndns.org>
2009/2/10 Junio C Hamano <gitster@pobox.com>:
Show 57 quoted lines
> Mark Burton <markb@ordern.com> writes:
>
>> 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/master
>
> which 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/master
>
> with 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
For me it makes sense.

Also this type of output for symrefs "-> master" makes even more sense in the verbose output.

Santi
Previous: Junio C HamanoNext: Jay Soffian
Message 7 of 16 in “builtin-branch: highlight current remote branches with an asterisk”
  1. builtin-branch: highlight current remote branches with an asteriskJay Soffian, Feb 9, 2009
  2. Johannes SchindelinFeb 9, 2009
  3. Mark BurtonFeb 10, 2009
  4. Jay SoffianFeb 10, 2009
  5. Mark BurtonFeb 10, 2009
  6. Junio C HamanoFeb 10, 2009
  7. Santi BéjarFeb 10, 2009
  8. Jay SoffianFeb 10, 2009
  9. Björn SteinbrinkFeb 10, 2009
  10. Santi BéjarFeb 10, 2009
  11. Björn SteinbrinkFeb 10, 2009
  12. Jeff KingFeb 10, 2009
  13. Björn SteinbrinkFeb 10, 2009
  14. Jeff KingFeb 10, 2009
  15. Björn SteinbrinkFeb 10, 2009
  16. Jeff KingFeb 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.