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

Re: --no-decorate and %d in git-log(1)

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 25, 2026, 20:08 UTC
Message-ID
<xmqqcy1sa8mx.fsf@gitster.g>
In-Reply-To
<8f6441ab-5c9a-4b42-ab2e-a670d462569d@xiplink.com>
Marc Branchaud <marcnarc@xiplink.com> writes:
Show 5 quoted lines
> BTW, --decorate=auto is documented as "if the output is going to a 
> terminal, the ref names are shown as if `short` were given, otherwise no 
> ref names are shown."  But in my experiments %d still shows refs even 
> when the output is piped to a file.  Seems like another symptom of the 
> same bug?

Isn't that documentation merely referring to "git log" without "--format=... %d ..." and not about the case where you explicitly ask for "%d"? That is, the description is there to explain the differences between

	git log --oneline --decorate=auto -1
	git log --oneline --decorate=auto -1 | cat

isn't it? I think --decorate=auto is the default so the above without --decorate=auto would behave similarly.

> (Do people who use `--format` (with or without %d) *also* use 
> `--decorate`?  It seems like the two are naturally exclusive, even if 
> the code allows them both.)

That is an interesting question, but I am not sure if it affects how we decide to resolve this discussion.

Previous: Marc BranchaudNext: Marc Branchaud
Message 6 of 9 in “--no-decorate and %d in git-log(1)”
  1. Alejandro ColomarFeb 25, 2026
  2. Junio C HamanoFeb 25, 2026
  3. Alejandro ColomarFeb 25, 2026
  4. Junio C HamanoFeb 25, 2026
  5. Marc BranchaudFeb 25, 2026
  6. Junio C HamanoFeb 25, 2026
  7. Marc BranchaudFeb 25, 2026
  8. Alejandro ColomarFeb 25, 2026
  9. Junio C HamanoMar 1, 2026

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.