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

Re: [PATCH 1/1] merge-recursive: avoid directory rename detection in recursive case

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2019, 17:26 UTC
Message-ID
<xmqqwofqjjdh.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190805223350.27504-1-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
> I know this bug doesn't satisfy the normal criteria for making it into
> 2.23 (it's a bug that was present in 2.22 rather than a regression in
> 2.23), but given that it's a BUG() condition, I was hoping it is
> important and safe enough to include anyway.

For maintenance and upcoming release, a safer "fix" to do might be to also (in addition to this patch) flip the default to no to revert to the stable state before "directory renames" was introduced, while still allowing those who want to help can explore the right fix to this codepath.

Show 17 quoted lines
> (This fix does merge down cleanly to master, next, and pu.)
>
>  merge-recursive.c                   |   3 +-
>  t/t6043-merge-rename-directories.sh | 111 ++++++++++++++++++++++++++++
>  2 files changed, 113 insertions(+), 1 deletion(-)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index d2e380b7ed..c7691d9b54 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -2856,7 +2856,8 @@ static int detect_and_process_renames(struct merge_options *opt,
>  	head_pairs = get_diffpairs(opt, common, head);
>  	merge_pairs = get_diffpairs(opt, common, merge);
>  
> -	if (opt->detect_directory_renames) {
> +	if ((opt->detect_directory_renames == 2) ||
> +	    (opt->detect_directory_renames == 1 && !opt->call_depth)) {
Previous: Junio C HamanoNext: Elijah Newren
Message 6 of 11 in “BUG() during criss-cross merge with directory rename and deleted file”
  1. Emily ShafferJul 26, 2019
  2. 1/1 merge-recursive: avoid directory rename detection in recursive caseElijah Newren, Aug 5, 2019
  3. Junio C HamanoAug 6, 2019
  4. Elijah NewrenAug 6, 2019
  5. Junio C HamanoAug 6, 2019
  6. Junio C HamanoAug 6, 2019
  7. Elijah NewrenAug 6, 2019
  8. Emily ShafferAug 6, 2019
  9. Elijah NewrenAug 6, 2019
  10. Emily ShafferAug 6, 2019
  11. Jeff KingAug 8, 2019

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.