]> git.ipfire.org Git - thirdparty/git.git/commit - pretty.c
pretty format %(trailers): add a "key_value_separator"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 9 Dec 2020 15:52:08 +0000 (16:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Dec 2020 22:16:42 +0000 (14:16 -0800)
commit058761f1c19b58afd6906672fc013327eb2096c6
tree4872479f5161cc5946b5fafea66ff6ce78deaa9b
parent9d87d5ae026433a2993fdb757fc80dbdcb078310
pretty format %(trailers): add a "key_value_separator"

Add a "key_value_separator" option to the "%(trailers)" pretty format,
to go along with the existing "separator" argument. In combination
these two options make it trivial to produce machine-readable (e.g. \0
and \0\0-delimited) format output.

As elaborated on in a previous commit which added "keyonly" it was
needlessly tedious to extract structured data from "%(trailers)"
before the addition of this "key_value_separator" option. As seen by
the test being added here extracting this data now becomes trivial.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
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