Re: Replicating the default "git log" format with a format string.
- From
Jeff King <peff@peff.net>
- Date
- Nov 13, 2015, 21:52 UTC
- Message-ID
- <20151113215246.GA14318@sigill.intra.peff.net>
- In-Reply-To
- <CA+P7+xro=nNfzO6Q6-kGe6C=vJp-z_svd229kRZdf5QjQ+Di8g@mail.gmail.com>
On Fri, Nov 13, 2015 at 01:41:23PM -0800, Jacob Keller wrote:
Show 9 quoted lines
> On Thu, Nov 12, 2015 at 9:38 PM, Jeff King <peff@peff.net> wrote: > >> Is it possible to exactly replicate the default "git log" format with a > >> format string? > > > > Sadly, no, I don't think it is possible with the current format > > specifiers. It would be nice if it was, though. > > Isn't this something that might be obtainable using the new ref-filter > work being done?
It moves in the right direction, but it isn't enough. I don't recall the specifics, but I think it has conditional placeholders for things like "if this is non-empty print it". But there are still some problems:
- the ref-filter formatting isn't unified with the commit
pretty-printer formatting. So this wouldn't help for a traversal,
anyway. - the decoration thing needs a new placeholder. "%d" means "always
show the decoration", but the OP really wants "show the decoration
if the user asked for decorations, and empty otherwise".-Peff