Web lists-archives.com

Re: Merge commit diff results are confusing and inconsistent




Hi Robert,

On Tue, May 07, 2019 at 09:10:12AM -0500, Robert Dailey wrote:

[snip]

> Even ignoring that issue, the more concerning observation of mine is
> that `diff @^!` produces any output at all. If you exclude both
> parents, why do I see a diff for parent 2 (I see the complete diff of
> the branch that was merged in)?
> 
> Again, thank you for your example, you definitely made things very
> clear for me. I see where the confusion is. And I think --cc is a good
> way to get more context. At this point I'm just concerned about the
> @^! behavior with merge commits & diff.

@^! is undocumented behaviour. Junio touched on why it behaves this way
here[1], in case you're interested.

For more details, this code[2] just blindly diffs the first two
endpoints returned preceding `repo_init_revisions`.

Also, not to rehash an old discussion but I'll let this thread be my
argument *against* allowing range-notation in git-diff.

[1]: https://public-inbox.org/git/xmqqef7ch80v.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx/
[2]: https://github.com/gitster/git/blob/master/builtin/diff.c#L385