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

Re: [PATCH 2/2] rebase -i: fix SIGSEGV when 'merge <branch>' fails

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2018, 16:04 UTC
Message-ID
<xmqqzhxmfgbb.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180815093935.10222-3-phillip.wood@talktalk.net>
Phillip Wood <phillip.wood@talktalk.net> writes:
> This commit implements a minimal fix which fixes the crash and allows
> the user to successfully commit a conflict resolution with 'git rebase
> --continue'. It does not write .git/rebase-merge/patch,
> .git/rebase-merge/stopped-sha or update REBASE_HEAD.

I think that should be OK. When merging, a patch that shows the diff from the merge base to the tip indeed is an interesting and useful reference material to help the conflict resolution, but it is not even clear what the latter two should mean while merging.

Show 18 quoted lines
> diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
> index 31fe4268d5..2e767d4f1e 100755
> --- a/t/t3430-rebase-merges.sh
> +++ b/t/t3430-rebase-merges.sh
> @@ -129,7 +129,7 @@ test_expect_success '`reset` refuses to overwrite untracked files' '
>  	git rebase --abort
>  '
>  
> -test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
> +test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
>  	test_when_finished "test_might_fail git rebase --abort" &&
>  	git checkout -b conflicting-merge A &&
>  
> @@ -151,6 +151,19 @@ test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
>  	test_path_is_file .git/rebase-merge/patch
>  '
>  
> +SQ="'"

A low-hanging fruit tangent, but somebody may want to go through the output from

    $ git grep '[Ss][Qq]_*=' t

and come up with a shared "convenience" definition of this, which perhaps sits next to the definition of $_x40 etc.

Show 15 quoted lines
> +test_expect_success 'failed `merge <branch>` does not crash' '
> +	test_when_finished "test_might_fail git rebase --abort" &&
> +	git checkout conflicting-G &&
> +
> +	echo "merge G" >script-from-scratch &&
> +	test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
> +	test_tick &&
> +	test_must_fail git rebase -ir HEAD &&
> +	! grep "^merge G$" .git/rebase-merge/git-rebase-todo &&
> +	grep "^Merge branch ${SQ}G${SQ}$" .git/rebase-merge/message
> +'
> +
>  test_expect_success 'with a branch tip that was cherry-picked already' '
>  	git checkout -b already-upstream master &&
>  	base="$(git rev-parse --verify HEAD)" &&
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 6 in “rebase -i: fix SIGSEGV when 'merge <branch>' fails”
  1. 0/2 rebase -i: fix SIGSEGV when 'merge <branch>' failsPhillip Wood, Aug 15, 2018
  2. 2/2 rebase -i: fix SIGSEGV when 'merge <branch>' failsPhillip Wood, Aug 15, 2018
  3. Johannes SchindelinAug 16, 2018
  4. Junio C HamanoAug 16, 2018
  5. Johannes SchindelinAug 27, 2018
  6. 1/2 t3430: add conflicting commitPhillip Wood, Aug 15, 2018

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.