Thread (3 messages) flat view 3 messages, 3 authors, 2026-02-25

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

From: Junio C Hamano <hidden>
Date: 2026-02-25 20:08:40

Marc Branchaud [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help