summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-04-18 23:08:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-18 23:28:29 (GMT)
commita57523428b4c08795e793356e12afc3de812f84a (patch)
tree49d70a10d94c4aadeb863adf73d078f27f5569d5 /Documentation
parenta95f067e3fc2b7c50c69680ac10bef528b160446 (diff)
downloadgit-a57523428b4c08795e793356e12afc3de812f84a.zip
git-a57523428b4c08795e793356e12afc3de812f84a.tar.gz
git-a57523428b4c08795e793356e12afc3de812f84a.tar.bz2
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')
-rw-r--r--Documentation/pretty-formats.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index bad627a..e2345d2 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