summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-04-18 23:08:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-18 23:28:29 (GMT)
commita7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba (patch)
treebbd2ecfc44a0e3349d2e419f379e653a008dc00f /Documentation
parenta57523428b4c08795e793356e12afc3de812f84a (diff)
downloadgit-a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba.zip
git-a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba.tar.gz
git-a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba.tar.bz2
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')
-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 e2345d2..d3450bf 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>)'