@matheusbsbs / matheus-bagliano / commits / fa5b4f37e4
Fork 0

document --pretty=tformat: option

This was introduced in 4da45bef, but never documented anywhere. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 12, 2008 at 02:14 UTC fa5b4f37e4517c7a422b227f565c9f21bdc8cc65
1 file changed +22
Documentation/pretty-formats.txt
+22
@@ -124,3 +124,25 @@ The placeholders are:
124 - '%m': left, right or boundary mark
125 - '%n': newline
126 - '%x00': print a byte from a hex code
127 +
128 +* 'tformat:'
129 ++
130 +The 'tformat:' format works exactly like 'format:', except that it
131 +provides "terminator" semantics instead of "separator" semantics. In
132 +other words, each commit has the message terminator character (usually a
133 +newline) appended, rather than a separator placed between entries.
134 +This means that the final entry of a single-line format will be properly
135 +terminated with a new line, just as the "oneline" format does.
136 +For example:
137 ++
138 +---------------------
139 +$ git log -2 --pretty=format:%h 4da45bef \
140 + | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
141 +4da45be
142 +7134973 -- NO NEWLINE
143 +
144 +$ git log -2 --pretty=tformat:%h 4da45bef \
145 + | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
146 +4da45be
147 +7134973
148 +---------------------