From: Junio C Hamano Date: Wed, 10 Feb 2010 00:05:50 GMT Subject: Re: What should I do to display the diff of even a simple merge commit? Message-ID: <7v1vguuf8h.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100209235707.GQ9553@machine.or.cz> Petr Baudis 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.