Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-11-01 Thread Jeff King
On Thu, Nov 01, 2018 at 12:01:28AM +0100, Anders Waldenborg wrote: > Jeff King writes: > > > On the other hand, if the rule were not "this affects the next > > placeholder" but had a true ending mark, then we could make a real > > parse-tree out of it, and format chunks of placeholders. E.g.: >

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-31 Thread Anders Waldenborg
Jeff King writes: > On the other hand, if the rule were not "this affects the next > placeholder" but had a true ending mark, then we could make a real > parse-tree out of it, and format chunks of placeholders. E.g.: > > %(format:lpad=30,filename)%(subject) %(authordate)%(end) > > would pad

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-31 Thread Jeff King
On Mon, Oct 29, 2018 at 06:05:34PM +0100, Anders Waldenborg wrote: > I'll start by reworking my patch to handle %(trailers:key=X) (I'll > assume keys never contain ')' or ','), and ignore any formatting until > the way forward there is decided (see below). IMHO that is probably an acceptable

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-29 Thread Anders Waldenborg
On Mon, Oct 29, 2018 at 3:14 PM Jeff King wrote: > Junio's review already covered my biggest question, which is why not > something like "%(trailers:key=ticket)". And likewise making things like > comma-separation options. Jeff, Junio, thanks! Your questions pretty much matches what I (and a

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-29 Thread Jeff King
On Sun, Oct 28, 2018 at 01:50:25PM +0100, Anders Waldenborg wrote: > This new format placeholder allows displaying only a single > trailer. The formatting done is similar to what is done for > --decorate/%d using parentheses and comma separation. Displaying a single trailer makes sense as a

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-28 Thread Junio C Hamano
Anders Waldenborg writes: > This new format placeholder allows displaying only a single > trailer. The formatting done is similar to what is done for > --decorate/%d using parentheses and comma separation. > > It's intended use is for things like ticket references in trailers. > > So with a

[PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-28 Thread Anders Waldenborg
This new format placeholder allows displaying only a single trailer. The formatting done is similar to what is done for --decorate/%d using parentheses and comma separation. It's intended use is for things like ticket references in trailers. So with a commit with a message like: > Some good