Code

document --pretty=tformat: option
authorJeff King <peff@peff.net>
Thu, 12 Jun 2008 06:14:28 +0000 (02:14 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Jun 2008 05:22:36 +0000 (22:22 -0700)
This was introduced in 4da45bef, but never documented anywhere.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt

index e8bea3e18e569e702233d0bb986fc7e52266d445..ec3755579408ebae58c7de644609590f5636b9c6 100644 (file)
@@ -124,3 +124,25 @@ The placeholders are:
 - '%m': left, right or boundary mark
 - '%n': newline
 - '%x00': print a byte from a hex code
+
+* 'tformat:'
++
+The 'tformat:' format works exactly like 'format:', except that it
+provides "terminator" semantics instead of "separator" semantics. In
+other words, each commit has the message terminator character (usually a
+newline) appended, rather than a separator placed between entries.
+This means that the final entry of a single-line format will be properly
+terminated with a new line, just as the "oneline" format does.
+For example:
++
+---------------------
+$ git log -2 --pretty=format:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973 -- NO NEWLINE
+
+$ git log -2 --pretty=tformat:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973
+---------------------