All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Show all branches and ahead/behind states
Date: Thu, 14 May 2015 19:29:47 +0200	[thread overview]
Message-ID: <1431624587.31573.5.camel@kaarsemaker.net> (raw)
In-Reply-To: <CAHd499CQTW0J6ms+XYUBbyfT6gGKuiFFCiP57i8-eTwng+UzNQ@mail.gmail.com>

On do, 2015-05-14 at 12:18 -0500, Robert Dailey wrote:
> On Thu, May 14, 2015 at 10:55 AM, Dennis Kaarsemaker
> <dennis@kaarsemaker.net> wrote:
> > On do, 2015-05-14 at 09:57 -0500, Robert Dailey wrote:
> >> Is there a script or built-in functionality in git 2.4.1 that will
> >> allow me to list all local branches with the ahead and behind status
> >> of each? Basically the first line of:
> >>
> >> $ git status -sb
> >>
> >> But for every branch would be roughly what I'm looking for. Any ideas? Thanks.
> >
> > git branch -v (or -vv) is what you're after.
> > --
> > Dennis Kaarsemaker
> > www.kaarsemaker.net
> >
> 
> Nice, I never noticed that -v showed ahead/behind status. Would be
> nice if branch had a --format option to customize the coloring of the
> "ahead" / "behind" text so that there was more contrast. It's a lot of
> information to consume especially with a lot of local branches;
> coloring would bring some sanity.

Fortunately for you, git for-each-ref lets you do just this. For
example, this gives you what branch -vv does, minus coloration and
padding:

git for-each-ref --format '%(HEAD) %(refname:short) %(upstream:short) %(upstream:track) %(subject)' refs/heads

-- 
Dennis Kaarsemaker
www.kaarsemaker.net

  reply	other threads:[~2015-05-14 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 14:57 Show all branches and ahead/behind states Robert Dailey
2015-05-14 15:55 ` Dennis Kaarsemaker
2015-05-14 17:18   ` Robert Dailey
2015-05-14 17:29     ` Dennis Kaarsemaker [this message]
2015-05-14 18:13       ` Robert Dailey
2015-05-14 22:38         ` Jeff King
2015-05-15 14:25           ` Robert Dailey
2015-05-15 16:59             ` Jeff King

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=1431624587.31573.5.camel@kaarsemaker.net \
    --to=dennis@kaarsemaker.net \
    --cc=git@vger.kernel.org \
    --cc=rcdailey.lists@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.