Subject: Re: [PATCH] log: --remerge-diff needs to keep around commit parents

From: Junio C Hamano <[email-masked]>
Date: Mon, 11 Nov 2024 10:52:41 +0900

Elijah Newren <[email-masked]> writes:

>> -               if (!rev->reflog_info) {
>> +               if (!rev->reflog_info && !rev->remerge_diff) {
>>                         /*
>>                          * We may show a given commit multiple times when
>>                          * walking the reflogs.
>
> Should this comment be updated to reflect the expanded rationale for
> this block's purpose?

Ah, we probably should.  Especially if the newly discovered failure
mode is not due to having to show the same commit multiple times.

    During reflog walk, we may show the same commit more than once,
    so do not discard the parents.  There may be a merge commit that
    is descendent from the current commit, and in order to show it with
    remerge-diff enabled, we need its ancestry chain, including our
    parents, to compute the merge base.

or something?  It is still not clear to me in what scenario a merge
commit, in a forward traversal, is shown _after_ one of its ancestor
commit is shown (and due to the memory optimization, loses its
parents).

Thanks, both.