Thread (1 message) 1 message, 1 author, 2021-05-04

Re: Why doesn't `git log -m` imply `-p`?

From: Junio C Hamano <hidden>
Date: 2021-05-04 01:15:37

Sergey Organov [off-list ref] writes:
quoted
 * "--patch", "--stat", "--cc" etc are to specify if we use the diff
   machinery and what kind of output is desired.
So, in your view, --cc output is not a product of "diff machinery"?
I view --cc and -c as an enhanced form of --patch that is also
capable of handling multi-way diffs, in other words, choosing --cc
should be to say "give me textual patch for all commits; when there
are multiple parents, condense multi-way patches".

So, yes, strictly speaking, --diff-merges=cc was probably a mistake,
and in the ideal world, --diff-merges should have taken only one of
"compare with nothing" (optional), "compare with first-parent", and
"compare with all parents".  The last choice could output diffs in
various forms, like traditional -m (i.e. patch output separately for
each parent), --cc, -c, etc.  "compare with nothing" is optional
because we could also control on the "output format" side to say
"produce no output" (ala "git show -s").

But such an idealized orthogonal design without special casing will
often lead to usability problems and complaints that -m alone does
not produce anything, so I am OK to have cc and friends as the value
for --diff-merges for that reason.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help