Re: [PATCH 00/26] git-log: implement new --diff-merge options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 9, 2020, 01:17 UTC
- Message-ID
- <xmqqtusv4w2g.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CABPp-BE3D7ifQx6MZCT_ntRnG0QZm1Ga10SJ=DN+6bpF6mX2GQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
> ... I guess I'm not sure why one would ever > want to see diffs for merges and not for normal commits. Even in the > unusual case someone did, couldn't they just pass --merges (to strip > out the normal commits entirely)?
Giving "--merges" would skip the single-strand-of-pearls commits entirely, not even showing their log messages, so it won't be an equivalent substitute.
Show 5 quoted lines
> Honestly, I find it a little surprising that despite the fact that log > -p shows nothing for merge commits, that when I add --first-parent to > see a subset of commits I suddenly get weird, huge diffs shown for the > merges (yeah, yeah, I learned recently that it's documented behavior, > so it's not surprising anymore, just weird).
I view "--first-parent" as telling "git log" to pretend all merges are single-parent commits (as if you did squash merges), and it is a natural consequence if "log --first-parent -p" showed each commit with its first parent, whether it is a merge or a single-parent commit.