diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-04-19 09:08:50 +1000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-18 16:28:29 -0700 |
commit | a57523428b4c08795e793356e12afc3de812f84a (patch) | |
tree | 49d70a10d94c4aadeb863adf73d078f27f5569d5 /Documentation/pretty-formats.txt | |
parent | a95f067e3fc2b7c50c69680ac10bef528b160446 (diff) | |
download | git-a57523428b4c08795e793356e12afc3de812f84a.tar.gz git-a57523428b4c08795e793356e12afc3de812f84a.tar.xz |
pretty: support padding placeholders, %< %> and %><
Either %<, %> or %>< standing before a placeholder specifies how many
columns (at least as the placeholder can exceed it) it takes. Each
differs on how spaces are padded:
%< pads on the right (aka left alignment)
%> pads on the left (aka right alignment)
%>< pads both ways equally (aka centered)
The (<N>) follows them, e.g. `%<(100)', to specify the number of
columns the next placeholder takes.
However, if '|' stands before (<N>), e.g. `%>|(100)', then the number
of columns is calculated so that it reaches the Nth column on screen.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/pretty-formats.txt')
-rw-r--r-- | Documentation/pretty-formats.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index bad627a93..e2345d229 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -164,6 +164,14 @@ The placeholders are: - '%x00': print a byte from a hex code - '%w([<w>[,<i1>[,<i2>]]])': switch line wrapping, like the -w option of linkgit:git-shortlog[1]. +- '%<(<N>)': make the next placeholder take at least N columns, + padding spaces on the right if necessary +- '%<|(<N>)': make the next placeholder take at least until Nth + columns, padding spaces on the right if necessary +- '%>(<N>)', '%>|(<N>)': similar to '%<(<N>)', '%<|(<N>)' + respectively, but padding spaces on the left +- '%><(<N>)', '%><|(<N>)': similar to '%<(<N>)', '%<|(<N>)' + respectively, but padding both sides (i.e. the text is centered) NOTE: Some placeholders may depend on other options given to the revision traversal engine. For example, the `%g*` reflog options will |