git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Typo in RelNotes.

From
Jeff King <peff@peff.net>
Date
Jun 12, 2008, 06:14 UTC
Message-ID
<20080612061428.GA28696@sigill.intra.peff.net>
In-Reply-To
<905315640806112206g4df6ce11h2a98412223e13fdd@mail.gmail.com>
On Wed, Jun 11, 2008 at 10:06:13PM -0700, Tarmigan wrote:
Show 6 quoted lines
> > Maybe I am blind, but I don't see a typo. Are you referring to tformat,
> > which looks like a typo, but is actually correct?
> 
> Oops you're right.  That's what I was thinking of.  Junio's commit
> message explains it well.  Should something be added to the man page
> about it?

How about this? I worry that the perl in the example is unnecessarily complex, but I couldn't think of a simpler way to show "in this one, the trailing newline is missing". So I am open to suggestions.

-- >8 -- document --pretty=tformat: option

This was introduced in 4da45bef, but never documented
anywhere.
---
 Documentation/pretty-formats.txt |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index e8bea3e..14a2665 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -124,3 +124,24 @@ 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 separator (usually a newline)
+appended, rather than 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
+---------------------
-- 
1.5.6.rc2.168.g23af0b.dirty
Previous: Tarmigan
Message 5 of 5 in “Typo in RelNotes.”
  1. Typo in RelNotes.Mikael Magnusson, Jun 12, 2008
  2. TarmiganJun 12, 2008
  3. Jeff KingJun 12, 2008
  4. TarmiganJun 12, 2008
  5. Jeff KingJun 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.