Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-12 Thread Junio C Hamano
Jeff King p...@peff.net writes: I dunno. I wrote that original set of lua pretty-format patches to try to stop the insanity once and for all. But I realized that I do not actually want to do anything complicated with the output formats, and --oneline and a few simple --format calls usually

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-11 Thread Jeff King
On Wed, Sep 10, 2014 at 10:19:21AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Something like the patch below might work, but I didn't test it very thoroughly (and note the comments, which might need dealing with). Maybe it would make a sensible base for Harry to build

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: Something like the patch below might work, but I didn't test it very thoroughly (and note the comments, which might need dealing with). Maybe it would make a sensible base for Harry to build on if he wants to pursue this. With it, you can do: git log

[PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Harry Jeffery
Add a new format prefix `_` that causes a line-feed to be inserted immediately after an expansion if the expansion expands to a non-empty string. This is useful for when you would like a line for an expansion to be prepended, but only when the expansion expands to a non empty string, such as

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Junio C Hamano
Harry Jeffery ha...@exec64.co.uk writes: Add a new format prefix `_` that causes a line-feed to be inserted immediately after an expansion if the expansion expands to a non-empty string. This is useful for when you would like a line for an expansion to be prepended, but only when the

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Harry Jeffery
On 09/09/14 20:15, Junio C Hamano wrote: Is this different from %n%-d? Yes. %n%-d will place the newline before the expansion, not after. log --decorate --pretty=format:%n%-d%h\\ %t\\ [%cn]\\ %s --- (HEAD, upstream/master, master)85f0837 c29da1d [Junio C Hamano] Start the post-2.1 cycle

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Junio C Hamano
Harry Jeffery ha...@exec64.co.uk writes: On 09/09/14 20:15, Junio C Hamano wrote: Is this different from %n%-d? Yes. %n%-d will place the newline before the expansion, not after. Maybe %[-+ ] needs to be rethought, instead of making things worse by turning it into %[-_+ ], as the next

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Jeff King
On Tue, Sep 09, 2014 at 12:37:48PM -0700, Junio C Hamano wrote: Harry Jeffery ha...@exec64.co.uk writes: On 09/09/14 20:15, Junio C Hamano wrote: Is this different from %n%-d? Yes. %n%-d will place the newline before the expansion, not after. Maybe %[-+ ] needs to be rethought,

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Harry Jeffery
On 09/09/14 22:45, Jeff King wrote: Yeah, that was my thought on reading the initial patch, too. Why limit ourselves to newlines and spaces. I'd much rather have full conditional expansion, like ${foo:+prefix $foo suffix} in the shell. Something like the patch below might work, but I didn't

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-09 Thread Jeff King
On Tue, Sep 09, 2014 at 11:17:20PM +0100, Harry Jeffery wrote: I definitely prefer your more general solution to my bare-minimum-to-scratch-itch patch. I'd certainly be willing to take your patch and expand upon it (pun unintended) once Junio has weighed in on your suggestions. Thanks. I am