summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2020-12-09 16:52:08 +0100
committerJunio C Hamano <gitster@pobox.com>2020-12-09 14:16:42 -0800
commit058761f1c19b58afd6906672fc013327eb2096c6 (patch)
tree4872479f5161cc5946b5fafea66ff6ce78deaa9b /Documentation
parent9d87d5ae026433a2993fdb757fc80dbdcb078310 (diff)
downloadgit-058761f1c19b58afd6906672fc013327eb2096c6.tar.gz
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>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/pretty-formats.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 5eac36500d..6b59e28d44 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -284,6 +284,10 @@ option is given with no value, it's enabled.
`%(trailers:only,unfold=true)` unfolds and shows all trailer lines.
** 'keyonly[=<BOOL>]': only show the key part of the trailer.
** 'valueonly[=<BOOL>]': only show the value part of the trailer.
+** 'key_value_separator=<SEP>': specify a separator inserted between
+ trailer lines. When this option is not given each trailer key-value
+ pair is separated by ": ". Otherwise it shares the same semantics
+ as 'separator=<SEP>' above.
NOTE: Some placeholders may depend on other options given to the
revision traversal engine. For example, the `%g*` reflog options will