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

Re: git branch -a now reports 'remotes/foo' rather than 'foo'?

From
Daniel Pittman <daniel@rimspace.net>
Date
May 11, 2009, 07:01 UTC
Message-ID
<87my9knmwi.fsf@rimspace.net>
In-Reply-To
<76718490905102226w4cda3a75l5062e1956129dc87@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
> On Sun, May 10, 2009 at 10:16 PM, Daniel Pittman <daniel@rimspace.net> wrote:
>> The front-end I am using looks for a 'trunk' branch by name in the
>> output of 'git branch -a', which historically worked.  Now, though, it
>> shows that fully qualified.
[...]
Show 10 quoted lines
>> I wanted to confirm that this was a deliberate change before I went to
>> the trouble or rewriting the front-end code however.
>
> Yes, the change was deliberate. Commit 209d336 (builtin-branch:
> improve output when displaying remote branches, 2009-02-13) has more
> details:
>
>     When displaying local and remote branches, prefix the remote
>     branch names with "remotes/" to make the remote branches clear
>     from the local branches.

Isn't the use of colour sufficient to do this? Ah, well. That horse, I think, has bolted, and my own end-users thoughts about the incoherence are, I suspect, of little relevance now.

Show 7 quoted lines
>     If displaying only the remote branches, the prefix is not shown
>     since it would be redundant.
>
> When you fix your front-end, I suggest you stop parsing git branch's
> output. It is a so-called porcelain command, as opposed to a plumbing
> command, and so its output is subject to change. You probably want to
> use the for-each-ref command instead.

It isn't my front-end, but I shall take a look and see if I can send upstream a suitable patch. Thanks for the advice.

Regards,
        Daniel
Previous: Jay Soffian
Message 3 of 3 in “git branch -a now reports 'remotes/foo' rather than 'foo'?”
  1. Daniel PittmanMay 11, 2009
  2. Jay SoffianMay 11, 2009
  3. Daniel PittmanMay 11, 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.