Re: [PATCH] log: --remerge-diff needs to keep around commit parents
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 11, 2024, 01:52 UTC
- Message-ID
- <xmqq1pzik046.fsf@gitster.g>
- In-Reply-To
- <CABPp-BHauuserYU8t5ybn+ghqRb-c85qwwjLWVe-e5EC8sVVxQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 8 quoted lines
>> - 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.