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.