Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: What should I do to display the diff of even a simple merge commit?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:13

Possibly related (same subject, not in this thread)

Petr Baudis [off-list ref] writes:
  I'm not sure if there is any clever switch for this, but I usually
just use one of

	git diff mergecommit^1 mergecommit
	git diff mergecommit^2 mergecommit

depending on which parent I want the diff against. If you always do your
merges as "on mainline, merging in a topic" without fast-forwarding,
diff against the first parent will be probably the right one and you can
simply use:

	git diff mergecommit^ mergecommit
Frankly, we should make "git log --first-parent -p" DTRT, I think.

The attitude towards merges we maintain officially is "all parents are
equal", but in practice, there often are cases where --first-parent
traversal makes a lot more sense when browsing the history (especially
"the official" one).  The use of that option should be a clear enough sign
that diff between the first parent and the merge result is asked for.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help