{"thread":{"id":"59872","subject":"[PATCH] ls-tree: fix documentation of %x format placeholder","startedAt":"2023-06-15T17:33:46Z","lastAt":"2023-06-15T17:33:46Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"478442","messageId":"23e54256-9ad5-e978-d0b8-abb511232fd1@web.de","threadId":"59872","inReplyTo":null,"subject":"[PATCH] ls-tree: fix documentation of %x format placeholder","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2023-06-15T17:33:39Z","receivedAt":"2023-06-15T17:33:46Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"ls-tree --format expands %x followed by two hexadecimal digits to the\ncharacter indicated by that hexadecimal number, e.g.:\n\n   $ git ls-tree --format=%x41 HEAD | head -1\n   A\n\nIt rejects % followed by a hexadecimal digit, e.g.:\n\n   $ git ls-tree --format=%41 HEAD | head -1\n   fatal: bad ls-tree format: element '41' does not start with '('\n\nThis functionality is provided by strbuf_expand_literal_cb(), which has\nnot been changed since it was factored out by fd2015b323 (strbuf:\nseparate callback for strbuf_expand:ing literals, 2019-01-28).\n\nAdjust the documentation accordingly.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n Documentation/git-ls-tree.txt | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt\nindex 0240adb8ee..af06ce14ed 100644\n--- a/Documentation/git-ls-tree.txt\n+++ b/Documentation/git-ls-tree.txt\n@@ -86,9 +86,9 @@ OPTIONS\n --format=<format>::\n \tA string that interpolates `%(fieldname)` from the result\n \tbeing shown. It also interpolates `%%` to `%`, and\n-\t`%xx` where `xx` are hex digits interpolates to character\n-\twith hex code `xx`; for example `%00` interpolates to\n-\t`\\0` (NUL), `%09` to `\\t` (TAB) and `%0a` to `\\n` (LF).\n+\t`%xNN` where `NN` are hex digits interpolates to character\n+\twith hex code `NN`; for example `%x00` interpolates to\n+\t`\\0` (NUL), `%x09` to `\\t` (TAB) and `%x0a` to `\\n` (LF).\n \tWhen specified, `--format` cannot be combined with other\n \tformat-altering options, including `--long`, `--name-only`\n \tand `--object-only`.\n--\n2.41.0\n"}]}