Re: [PATCH v3 2/5] pretty: allow showing specific trailers
- From
Anders Waldenborg <anders@0x63.nu>
- Date
- Nov 25, 2018, 23:02 UTC
- Message-ID
- <87a7lw7oct.fsf@0x63.nu>
- In-Reply-To
- <xmqqy39o9tmq.fsf@gitster-ct.c.googlers.com>
Junio C Hamano writes:
Show 11 quoted lines
> Also, use of 'key=' automatically turns on 'only' as described, and > I tend to agree that it would a convenient default mode (i.e. when > picking certain trailers only with this mechanism, it is likely that > the user is willing to use %(subject) etc. to fill in what was lost > by the implicit use of 'only'), but at the same time, it makes me > wonder if we need to have a way to countermand an 'only' (or > 'unfold' for that matter) that was given earlier, e.g. > > %(trailers:key=signed-off-by,only=no) > > Thanks.
I'm not sure what that would mean. The non-trailer lines in the trailer block doesn't match the key.
Take this commit as an example:
$ git show -s --pretty=format:'%(trailers)' b4d065df03049bacfbc40467b60b13e804b7d289 Helped-by: Jeff King <peff@peff.net> [jc: took idea and log message from peff] Signed-off-by: Junio C Hamano <gitster@pobox.com>
With 'only' it shows: $ git show -s --pretty=format:'%(trailers:only)' b4d065df03049bacfbc40467b60b13e804b7d289 Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Now with a "key=signed-off-by" option I would imagine that as adding a "| grep -i '^signed-off-by:'" to the end. In both cases (with and without 'only') that would give the same result: "Signed-off-by: Junio C Hamano <gitster@pobox.com>"
anders