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

Re: [PATCH] git-apply: try threeway first when "--3way" is used

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2021, 06:14 UTC
Message-ID
<xmqq7dlg2b3d.fsf@gitster.g>
In-Reply-To
<20210406025551.25213-1-jerry@skydio.com>
Jerry Zhang <jerry@skydio.com> writes:
Show 11 quoted lines
> diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
> index d62db3fbe16f35a625a4a14eebb70034f695d3eb..0a7332fed5f60a8a2c9c25fc6713d513c3f0ace1 100755
> --- a/t/t4108-apply-threeway.sh
> +++ b/t/t4108-apply-threeway.sh
> @@ -160,4 +160,24 @@ test_expect_success 'apply -3 with add/add conflict (dirty working tree)' '
>  	test_cmp three.save three
>  '
>  
> +test_expect_success 'apply -3 with ambiguous repeating file' '
> +	git reset --hard &&
> +	test_write_lines 1 2 1 2 1 2 1 2 1 2 1>one_two_repeat &&
Missing SP before '>' (same issue on other redirections below).
Show 18 quoted lines
> +	git add one_two_repeat &&
> +	git commit -m "init one" &&
> +	test_write_lines 1 2 1 2 1 2 1 2 one 2 1>one_two_repeat &&
> +	git commit -a -m "change one" &&
> +
> +	git diff HEAD~ >Repeat.diff &&
> +	git reset --hard HEAD~ &&
> +
> +	test_write_lines 1 2 1 2 1 2 one 2 1 2 one>one_two_repeat &&
> +	git commit -a -m "change surrounding one" &&
> +
> +	git apply --index --3way Repeat.diff &&
> +	test_write_lines 1 2 1 2 1 2 one 2 one 2 one>expect &&
> +
> +	test_cmp expect one_two_repeat
> +'
> +
>  test_done
Previous: Junio C HamanoNext: Jerry Zhang
Message 4 of 6 in “git-apply: try threeway first when "--3way" is used”
  1. git-apply: try threeway first when "--3way" is usedJerry Zhang, Apr 6, 2021
  2. Junio C HamanoApr 6, 2021
  3. Junio C HamanoApr 6, 2021
  4. Junio C HamanoApr 6, 2021
  5. git-apply: try threeway first when "--3way" is usedJerry Zhang, Apr 6, 2021
  6. Junio C HamanoApr 7, 2021

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.