aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/pretty-formats.txt
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-04-19 09:08:51 +1000
committerJunio C Hamano <gitster@pobox.com>2013-04-18 16:28:29 -0700
commita7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba (patch)
treebbd2ecfc44a0e3349d2e419f379e653a008dc00f /Documentation/pretty-formats.txt
parenta57523428b4c08795e793356e12afc3de812f84a (diff)
downloadgit-a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba.tar.gz
pretty: support truncating in %>, %< and %><
%>(N,trunc) truncates the right part after N columns and replace the last two letters with "..". ltrunc does the same on the left. mtrunc cuts the middle out. 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.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index e2345d2290..d3450bf96f 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -164,8 +164,11 @@ 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>[,trunc|ltrunc|mtrunc])': make the next placeholder take at
+ least N columns, padding spaces on the right if necessary.
+ Optionally truncate at the beginning (ltrunc), the middle (mtrunc)
+ or the end (trunc) if the output is longer than N columns.
+ Note that truncating only works correctly with N >= 2.
- '%<|(<N>)': make the next placeholder take at least until Nth
columns, padding spaces on the right if necessary
- '%>(<N>)', '%>|(<N>)': similar to '%<(<N>)', '%<|(<N>)'