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

By default trailer lines are terminated by linebreaks ('\n'). By
specifying the new 'separator' option they will instead be separated by
user provided string and have separator semantics rather than terminator
semantics. The separator string can contain the literal formatting codes
%n and %xNN allowing it to be things that are otherwise hard to type
such as %x00, or comma and end-parenthesis which would break parsing.

E.g:
 $ git log --pretty='%(trailers:key=Reviewed-by,valueonly,separator=%x00)'

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