]> git.ipfire.org Git - thirdparty/git.git/commit - trailer.c
pretty: add support for "valueonly" option in %(trailers)
authorAnders Waldenborg <anders@0x63.nu>
Mon, 28 Jan 2019 21:33:35 +0000 (22:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 18:03:32 +0000 (10:03 -0800)
commitd9b936db5226ed4b87d42a2c91324adc50c768b6
tree8f8c8c7460c3278063e62ec98cc44be4e5c0c6ea
parent250bea0c1652ad546cd0455852bd734e4820ec46
pretty: add support for "valueonly" option in %(trailers)

With the new "key=" option to %(trailers) it often makes little sense to
show the key, as it by definition already is knows which trailer is
printed there. This new "valueonly" option makes it omit the key when
printing trailers.

E.g.:
 $ git show -s --pretty='%s%n%(trailers:key=Signed-off-by,valueonly)' aaaa88182
will show:
 > upload-pack: fix broken if/else chain in config callback
 > Jeff King <peff@peff.net>
 > Junio C Hamano <gitster@pobox.com>

Signed-off-by: Anders Waldenborg <anders@0x63.nu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt
pretty.c
t/t4205-log-pretty-formats.sh
trailer.c
trailer.h