From: Jeff King Date: Fri, 13 Nov 2015 21:52:46 GMT Subject: Re: Replicating the default "git log" format with a format string. Message-ID: <20151113215246.GA14318@sigill.intra.peff.net> In-Reply-To: On Fri, Nov 13, 2015 at 01:41:23PM -0800, Jacob Keller wrote: > On Thu, Nov 12, 2015 at 9:38 PM, Jeff King 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