Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Jeff King <peff@peff.net>
Cc: "Nathan W. Panike" <nathan.panike@gmail.com>,
	E R <pc88mxer@gmail.com>,
	git@vger.kernel.org
Subject: Re: help with git query
Date: Tue, 14 Apr 2009 08:26:52 +0200	[thread overview]
Message-ID: <20090414062652.GC3948@atjola.homenet> (raw)
In-Reply-To: <20090414054654.GC19027@coredump.intra.peff.net>

On 2009.04.14 01:46:54 -0400, Jeff King wrote:
> On Mon, Apr 13, 2009 at 03:31:49PM -0500, Nathan W. Panike wrote:
> 
> > > for each branch:
> > >  - info about the latest commit on that branch (date and time, message, etc.)
> > 
> > Depending on what you want to do---from a bash shell, you could do:
> > 
> > for i in $(git branch -a | cut -b3-); do echo $i; git show -s $i; echo; done
> 
> Ick, please use the plumbing designed for this exact thing instead of
> trying to parse "git branch":
> 
>   $ git for-each-ref --format='%(subject)
>     %(authorname) %(authoremail)
>     %(authordate)' refs/heads/
> 
> or however you want to format it. See "git help for-each-ref" for a list
> of fields (you can also just pipe the output of for-each-ref into a
> shell loop, as in your example, but with the format options there is
> often no need).

git log --no-walk --branches --decorate --pretty=short

is what I use, sometimes. Some other "pretty" format might be more
suitable for your use case.

Björn

      reply	other threads:[~2009-04-14  6:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 18:51 help with git query E R
2009-04-13 20:31 ` Nathan W. Panike
2009-04-13 20:57   ` E R
2009-04-13 22:33     ` Nathan W. Panike
2009-04-14  5:46   ` Jeff King
2009-04-14  6:26     ` Björn Steinbrink [this message]

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=20090414062652.GC3948@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=nathan.panike@gmail.com \
    --cc=pc88mxer@gmail.com \
    --cc=peff@peff.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