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

Re: Show all branches and ahead/behind states

From
Jeff King <peff@peff.net>
Date
May 15, 2015, 16:59 UTC
Message-ID
<20150515165912.GA26853@peff.net>
In-Reply-To
<CAHd499Am4PFo-YRJEbQfPqtk571f4eNr_gkdy-3ATzyvBcc-jw@mail.gmail.com>
On Fri, May 15, 2015 at 09:25:22AM -0500, Robert Dailey wrote:
Show 8 quoted lines
> > It's spelled "%C(bold blue)" in the --pretty formats, but in
> > for-each-ref, it's "%(color:bold blue)". Unifying these is one of those
> > things that has been on the radar for a long time, but nobody has quite
> > gotten around to it.
> >
> Thanks Jeff! That definitely fixed it. I was not able to find a
> reference for this in the git docs, maybe I just overlooked it
> somewhere.
It's in "git help for-each-ref" (see the section on "FIELD NAMES").
Show 5 quoted lines
> As a second query, is there a way to do column alignment? For example,
> I would like the ahead/behind status in one column, and the branch
> names left aligned in a 2nd column. I can't simply use tabs here since
> the length of column 1 may differ more greatly than a single tab
> character.

The "--pretty" format does have "%<" for doing printf-style alignment (see the "PRETTY FORMATS" section of "git help log"). But "for-each-ref" doesn't have any similar facility, as far as I know.

Again, this is something that it would be nice to fix.
-Peff
Previous: Robert Dailey
Message 8 of 8 in “Show all branches and ahead/behind states”
  1. Robert DaileyMay 14, 2015
  2. Dennis KaarsemakerMay 14, 2015
  3. Robert DaileyMay 14, 2015
  4. Dennis KaarsemakerMay 14, 2015
  5. Robert DaileyMay 14, 2015
  6. Jeff KingMay 14, 2015
  7. Robert DaileyMay 15, 2015
  8. Jeff KingMay 15, 2015

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.