Re: Merge commit diff results are confusing and inconsistent
- From
Denton Liu <liu.denton@gmail.com>
- Date
- May 7, 2019, 14:58 UTC
- Message-ID
- <20190507145849.GA6313@archbookpro.localdomain>
- In-Reply-To
- <CAHd499BkdpsA2BdB0Hsv3xXzpMyMzW8CSuYf2gQX0Jf7OoYBGw@mail.gmail.com>
Hi Robert,
On Tue, May 07, 2019 at 09:10:12AM -0500, Robert Dailey wrote:
[snip]
Show 9 quoted lines
> 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@gitster-ct.c.googlers.com/ [2]: https://github.com/gitster/git/blob/master/builtin/diff.c#L385