Re: [RFC PATCH] `log --merge` also for rebase/cherry pick/revert
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2024, 20:21 UTC
- Message-ID
- <xmqqr0im9ub9.fsf@gitster.g>
- In-Reply-To
- <47a4418b-68bf-4850-ba8b-1a5264f923e4@gmail.com>
phillip.wood123@gmail.com writes:
Show 16 quoted lines
> I should start by saying that I didn't know "git log --merge" existed > before I saw this message so please correct me if I've misunderstood > what this patch is doing. If I understand correctly it shows the > commits from each side of the merge and is equivalent to > > git log HEAD MERGE_HEAD ^$(git merge-base HEAD MERGE_HEAD) > > When a commit is cherry-picked the merge base used is > CHERRY_PICK_HEAD^ [*] so I'm not sure what > > git log HEAD CHERRY_PICK_HEAD ^$(git merge-base HEAD CHERRY_PICK_HEAD) > > tells us. Indeed there HEAD and CHERRY_PICK_HEAD may not share a > common ancestor. As I say I've not used "git log --merge" so maybe I'm > missing the reason why it would be useful when cherry-picking or > rebasing.
Good question. It is the whole point of cherry-pick that CHERRY_PICK_HEAD and the current HEAD may not have any meaningful ancestry relationship, so yes, it is questionable to use the same logic for "log --merge" between HEAD...CHERRY_PICK_HEAD, while using HEAD...MERGE_HEAD does make perfect sense.