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
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jan 15, 2015, 16:23 UTC
Message-ID
<54B7E98B.6020907@drmicha.warpmail.net>
In-Reply-To
<CAEKevnWfFq9gyN8Ga8zXUDwk_+Mk6RK0HVT-+sbejjVPw0U0=w@mail.gmail.com>
Francesc Zacarias schrieb am 15.01.2015 um 14:55:
Show 15 quoted lines
> Hi!
> 
> I noticed that git produces differing output for
> "git show --pretty:format show" and "git show --format", even though
> the man page says that both are equivalent.
> "git show --format" always appends an empty line at the end. The only
> way I've found to get rid of that empty line in --format is by adding
> -s option.
> 
> So, "git show --pretty:format" and "git show -s --format" do produce
> the same output.
> 
> I can reproduce this issue in Ubuntu Trusty (git version 1.9.1) and
> Debian Jessie (git version 2.1.4).
> 

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:".

Unfortunately, "--format" seems to be parsed as ("--pretty" and therefore?) "--pretty=tformat:" which I consider a bug.

Michael
Previous: Francesc ZacariasNext: Junio C Hamano
Message 2 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.