From: Jay Soffian <jaysoffian@gmail.com>
To: layer <layer@known.net>
Cc: git@vger.kernel.org
Subject: Re: git branch -a prefixes origin/ branches with remotes/
Date: Wed, 31 Mar 2010 17:59:49 -0400 [thread overview]
Message-ID: <k2r76718491003311459u4bbaeb4ax5b2e550acdd14c88@mail.gmail.com> (raw)
In-Reply-To: <18137.1270056387@relay.known.net>
On Wed, Mar 31, 2010 at 1:26 PM, layer <layer@known.net> wrote:
> In git 1.6.6.1 & 1.6.3.3, "git branch -a" output is like this
>
> * master
> remotes/origin/foo
> ...
>
> instead of like this for 1.6.1.3
>
> * master
> origin/foo
> ...
>
> Is this a feature or bug? I searched the mailing list archives and
> announcements couldn't find any reference to this change.
Feature. Introduced in 1.6.3:
http://article.gmane.org/gmane.comp.version-control.git/116404
See "builtin-branch: improve output when displaying remote branches"
> This is important to me because I use the output of "git branch -a" in
> scripts.
>
> I should add that the scripts are merely testing for the existence of
> remote tracking branches in the local repo. If there's a better way
> to do this, I'm game. Thanks.
git branch is a so-called porcelain command, and as you've now been
bitten by, the output of porcelain's is subject to change.
You probably want git for-each-ref.
Aside, the only list of plumbing vs porcelain commands I'm aware of is
in the bash-completion script under contrib. See
__git_list_porcelain_commands here:
http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/completion/git-completion.bash
Those are generally commands whose output you do not want to be
parsing. All the other git commands installed under git-core are
mostly plumbing upon which you can build additional functionality.
(Note to git list: there should be a man page that has a single-line
summary of each command and states whether the command is plumbing or
porcelain. Maybe there is and I just don't know it.)
j.
next prev parent reply other threads:[~2010-03-31 22:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 17:26 git branch -a prefixes origin/ branches with remotes/ layer
2010-03-31 17:52 ` Jakub Narebski
2010-03-31 21:59 ` Jay Soffian [this message]
2010-03-31 22:03 ` Jeff King
2010-03-31 22:04 ` Andreas Schwab
2010-03-31 22:09 ` Jay Soffian
2010-04-01 9:17 ` Michael J Gruber
-- strict thread matches above, loose matches on Subject: below --
2010-03-31 17:45 layer
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=k2r76718491003311459u4bbaeb4ax5b2e550acdd14c88@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=git@vger.kernel.org \
--cc=layer@known.net \
/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).