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

Re: cosmetic bug: "git show --pretty:format" produces different output than "git show --format"

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 15, 2015, 19:25 UTC
Message-ID
<xmqqegqv7sn8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54B7E98B.6020907@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> The first part of the man page is a bit sloppy, but refers to the FORMAT
> section. There, it says that "--pretty" is equivalent to
> "--pretty=tformat:" which is different from "--pretty=format:".

It is indeed sloppy. It says --(pretty|format)=<format> can take these canned <format>s or 'format:<string>', but

 - it does not say it can also take 'tformat:<string>' at all; and
 - it does not say a <format> that is none of the above is dwimmed
   with 'tformat:' prefixed.
Perhaps something like this is needed.
 Documentation/pretty-options.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index 8569e29..7e17af9 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -3,9 +3,13 @@
 
 	Pretty-print the contents of the commit logs in a given format,
 	where '<format>' can be one of 'oneline', 'short', 'medium',
-	'full', 'fuller', 'email', 'raw' and 'format:<string>'.  See
-	the "PRETTY FORMATS" section for some additional details for each
-	format.  When omitted, the format defaults to 'medium'.
+	'full', 'fuller', 'email', 'raw', 'format:<string>'
+	and 'tformat:<string>'.  When '<format>' is none of the above,
+	acts as if '--pretty=tformat:<format>' were given.
++
+See
+the "PRETTY FORMATS" section for some additional details for each
+format.  When omitted, the format defaults to 'medium'.
 +
 Note: you can specify the default pretty format in the repository
 configuration (see linkgit:git-config[1]).
Previous: Junio C Hamano
Message 4 of 4 in “cosmetic bug: "git show --pretty:format" produces different output than "git show --format"”
  1. Francesc ZacariasJan 15, 2015
  2. Michael J GruberJan 15, 2015
  3. Junio C HamanoJan 15, 2015
  4. Junio C HamanoJan 15, 2015

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.