git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 16, 2022, 21:46 UTC
Message-ID
<xmqqczkr1hhb.fsf@gitster.g>
In-Reply-To
<pull.1194.git.git.1642212566346.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 37 quoted lines
> From: Elijah Newren <newren@gmail.com>
>
> 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 <me@ttaylorr.com>
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
Thanks.  Will fork from maint-2.33 and park on 'seen' for now.
Previous: Elijah Newren via GitGitGadgetNext: Junio C Hamano
Message 2 of 12 in “merge-ort: avoid assuming all renames detected”
  1. merge-ort: avoid assuming all renames detectedElijah Newren via GitGitGadget, Jan 15, 2022
  2. Junio C HamanoJan 16, 2022
  3. Junio C HamanoJan 16, 2022
  4. merge-ort: avoid assuming all renames detectedElijah Newren via GitGitGadget, Jan 17, 2022
  5. Junio C HamanoJan 17, 2022
  6. Elijah NewrenJan 17, 2022
  7. Taylor BlauJan 17, 2022
  8. Junio C HamanoJan 17, 2022
  9. Junio C HamanoJan 17, 2022
  10. SZEDER GáborJun 30, 2022
  11. Elijah NewrenJul 1, 2022
  12. Elijah NewrenJul 1, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.