git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Daniel Pittman <daniel@rimspace.net>
Cc: git@vger.kernel.org
Subject: Re: git branch -a now reports 'remotes/foo' rather than 'foo'?
Date: Mon, 11 May 2009 01:26:02 -0400	[thread overview]
Message-ID: <76718490905102226w4cda3a75l5062e1956129dc87@mail.gmail.com> (raw)
In-Reply-To: <87skjcpeno.fsf@rimspace.net>

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.
>
> Looking at the release notes it looks like this was a deliberate change,
> from this entry:
>
> * "git-branch -r" shows HEAD symref that points at a remote branch in
>  interest of each tracked remote repository.
>
> However, that isn't unambiguously clear about the change, and is pretty
> light on the "why" parts.  Worse, the only discussion I can find about
> the change suggests that this was noticed, and there wasn't real clarity
> about the background.
>
> (See Jeff King under "[PATCH 1/2] add basic branch display tests" at [1]
>  for the details.)
>
>
> I confess, to me, that having 'git branch -a' and 'git branch -r' emit
> different values doesn't make much sense, but I suppose the upstream
> code can be adapted.
>
> 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. 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.

j.

  reply	other threads:[~2009-05-11  5:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11  2:16 git branch -a now reports 'remotes/foo' rather than 'foo'? Daniel Pittman
2009-05-11  5:26 ` Jay Soffian [this message]
2009-05-11  7:01   ` Daniel Pittman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76718490905102226w4cda3a75l5062e1956129dc87@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=daniel@rimspace.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).