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, 17:39 UTC
Message-ID
<xmqq8uh47xkq.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54B7E98B.6020907@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> Unfortunately, "--format" seems to be parsed as ("--pretty" and
> therefore?) "--pretty=tformat:" which I consider a bug.

"tformat:" was introduced to fix "format:, because many people found the latter hard to use, probably because most of the time they wanted to use the feature to show one-line-per-commit and a LF after each record ("terminator semantics" where 't' in "tformat:" comes from) made more sense in that context, compared to a LF between each record ("delimiter semantics").

Of course, "format:" that uses the delimiter semantics has its uses; after all, the delimiter semantics is what is used for canned formats, other than --oneline.

It was a deliberate design decision to make "--format=<string>" as a short-hand for "--pretty=tformat:<string>", favouring "tformat:" over "format:", AFAIK. To use the facility to show a break between each (likely multi-line) record, use "--pretty=format:<string>", not "--pretty=tformat:<string>" aka "--format=<string>".

Previous: Michael J GruberNext: Junio C Hamano
Message 3 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.