Thread (1 message) 1 message, 1 author, 2022-01-17

Re: [PATCH v2] merge-ort: avoid assuming all renames detected

From: Junio C Hamano <hidden>
Date: 2022-01-17 22:16:14

Elijah Newren [off-list ref] writes:
On Mon, Jan 17, 2022 at 11:33 AM Junio C Hamano [off-list ref] wrote:
quoted
"Elijah Newren via GitGitGadget" [off-list ref] writes:
quoted
From: Elijah Newren <redacted>

In commit 8b09a900a1 ("merge-ort: restart merge with cached renames to
reduce process entry cost", 2021-07-16), we noted that in the merge-ort
steps of
    collect_merge_info()
    detect_and_process_renames()
    process_entries()
that process_entries() was expensive, and we could often make it cheaper
by changing this to
    collect_merge_info()
    detect_and_process_renames()
    <cache all the renames, and restart>
    collect_merge_info()
    detect_and_process_renames()
    process_entries()
because the second collect_merge_info() would be cheaper (we could avoid
traversing into some directories), the second
detect_and_process_renames() would be free since we had already detected
all renames, and then process_entries() has far fewer entries to handle.

However, this was built on the assumption that the first
detect_and_process_renames() actually detected all potential renames.
If someone has merge.renameLimit set to some small value, that
assumption is violated which manifests later with the following message:

    $ git -c merge.renameLimit=1 rebase upstream
    ...
    git: merge-ort.c:546: clear_or_reinit_internal_opts: Assertion
    `renames->cached_pairs_valid_side == 0' failed.

Turn off this cache-renames-and-restart whenever we cannot detect all
renames, and add a testcase that would have caught this problem.

Reported-by: Taylor Blau <redacted>
Signed-off-by: Elijah Newren <redacted>
---
Thanks.  An Ack?
Taylor told me the code change fixed his case, and that he'd review my
full patch with the testcase when I posted it.  Let's wait to hear
from him.
Yes, I am waiting (notice who is on To: and not Cc: on the message
you are responding to ;-).

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help