Skip to content

Commit d664a7a

Browse files
PhilipOakleygitster
authored andcommitted
doc: pretty-formats: separate parameters from placeholders
Commit a575234 (pretty: support padding placeholders, %< %> and %><, 2013-04-19) introduced columnated place holders. These placeholders can be confusing as they contain `<` and `>` characters as part of their placeholders adjacent to the `<N>` parameters. Add spaces either side of the `<N>` parameters in the title line. The code (strtol) will consume any spaces around the number values (assuming they are passed as a quoted string with spaces). Note that the spaces are optional. Subsequent commits will clarify other confusions. Signed-off-by: Philip Oakley <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 262c45b commit d664a7a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Documentation/pretty-formats.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,24 +146,27 @@ The placeholders are:
146146
'%m':: left (`<`), right (`>`) or boundary (`-`) mark
147147
'%w([<w>[,<i1>[,<i2>]]])':: switch line wrapping, like the -w option of
148148
linkgit:git-shortlog[1].
149-
'%<(<N>[,trunc|ltrunc|mtrunc])':: make the next placeholder take at
149+
'%<( <N> [,trunc|ltrunc|mtrunc])':: make the next placeholder take at
150150
least N columns, padding spaces on
151151
the right if necessary. Optionally
152152
truncate at the beginning (ltrunc),
153153
the middle (mtrunc) or the end
154154
(trunc) if the output is longer than
155-
N columns. Note that truncating
155+
N columns.
156+
Note 1: that truncating
156157
only works correctly with N >= 2.
157-
'%<|(<N>)':: make the next placeholder take at least until Nth
158+
Note 2: spaces around the N
159+
values are optional.
160+
'%<|( <N> )':: make the next placeholder take at least until Nth
158161
columns, padding spaces on the right if necessary
159-
'%>(<N>)', '%>|(<N>)':: similar to '%<(<N>)', '%<|(<N>)' respectively,
162+
'%>( <N> )', '%>|( <N> )':: similar to '%<( <N> )', '%<|( <N> )' respectively,
160163
but padding spaces on the left
161-
'%>>(<N>)', '%>>|(<N>)':: similar to '%>(<N>)', '%>|(<N>)'
164+
'%>>( <N> )', '%>>|( <N> )':: similar to '%>( <N> )', '%>|( <N> )'
162165
respectively, except that if the next
163166
placeholder takes more spaces than given and
164167
there are spaces on its left, use those
165168
spaces
166-
'%><(<N>)', '%><|(<N>)':: similar to '%<(<N>)', '%<|(<N>)'
169+
'%><( <N> )', '%><|( <N> )':: similar to '%<( <N> )', '%<|( <N> )'
167170
respectively, but padding both sides
168171
(i.e. the text is centered)
169172

0 commit comments

Comments
 (0)