Subject: Re: [PATCH v3.1 3/5] Introduce new pretty formats %g[sdD] for reflog information

From: Jakub Narebski <[email-masked]>
Date: Sat, 17 Oct 2009 08:06:13 -0700 (PDT)

Thomas Rast <[email-masked]> writes:

> Note that the --format="%h %gD: %gs" tests may not work in real
> repositories, as the --pretty formatter doesn't know to leave away the
> ": " on the last commit in an incomplete (because git-gc removed the
> old part) reflog.  This equivalence is nevertheless the main goal of
> this patch.

Perhaps just-introduced grouping syntax would help there?  You could
for example write

  --format="%h%[all() %gD: %gs%]"

which would expand nested group if _all_ placeholders within it have
expansion.  Perhaps %[ ... %], or %[? ... %], or %[* ... %] could be
shorter versions...

-- 
Jakub Narebski
Poland
ShadeHawk on #git