Code

githooks.txt: add missing word
[git.git] / Documentation / pretty-formats.txt
index e8bea3e18e569e702233d0bb986fc7e52266d445..388d4925e6bc4bacb708f75437e9aaa216fcb9cc 100644 (file)
@@ -30,7 +30,7 @@ This is designed to be as compact as possible.
 
          commit <sha1>
          Author: <author>
-         Date: <date>
+         Date: <author date>
 
              <title line>
 
@@ -50,9 +50,9 @@ This is designed to be as compact as possible.
 
          commit <sha1>
          Author: <author>
-         AuthorDate: <date & time>
+         AuthorDate: <author date>
          Commit: <committer>
-         CommitDate: <date & time>
+         CommitDate: <committer date>
 
               <title line>
 
@@ -62,7 +62,7 @@ This is designed to be as compact as possible.
 
          From <sha1> <date>
          From: <author>
-         Date: <date & time>
+         Date: <author date>
          Subject: [PATCH] <title line>
 
          <full commit message>
@@ -101,13 +101,15 @@ The placeholders are:
 - '%P': parent hashes
 - '%p': abbreviated parent hashes
 - '%an': author name
+- '%aN': author name (respecting .mailmap)
 - '%ae': author email
-- '%ad': author date
+- '%ad': author date (format respects --date= option)
 - '%aD': author date, RFC2822 style
 - '%ar': author date, relative
 - '%at': author date, UNIX timestamp
 - '%ai': author date, ISO 8601 format
 - '%cn': committer name
+- '%cN': committer name (respecting .mailmap)
 - '%ce': committer email
 - '%cd': committer date
 - '%cD': committer date, RFC2822 style
@@ -124,3 +126,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
+---------------------