Message ID | bdb6c03f290c49bb96e6c0a3d9742a52@md6.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Bug: Commit a merge resolution with non-closed conflict markers leads to errs, segfault | expand |
BENTZ Sylvain wrote: > I've stumbled on a segmentation fault while resolving merge conflicts. > Basically, I missed to remove some conflict markers, tried to commit the > (faulty) merge resolution, and Git mishandles that. > > The original issue happened applying a patch using 3-way merge. The minimal > working example below creates a conflict with a simple `git merge` command. A quick workaround: git config --global rerere.enabled false But yeah, there seems to be a bug in `git rerere`.
Oh I wasn't aware of this when I initialized my MWE repo, from git-config[1]: By default, git-rerere[1] is enabled if there is an rr-cache directory under the $GIT_DIR, e.g. if "rerere" was previously used in the repository. The correct MWE requires to enable rerere: git config rerere.enabled true -- Sylvain Bentz
On Thu, Jul 22 2021, BENTZ Sylvain wrote: > Oh I wasn't aware of this when I initialized my MWE repo, from git-config[1]: > > By default, git-rerere[1] is enabled if there is an rr-cache directory under > the $GIT_DIR, e.g. if "rerere" was previously used in the repository. > > The correct MWE requires to enable rerere: > > git config rerere.enabled true I think the patch I posted at the end of https://lore.kernel.org/git/87v96p4w3f.fsf@evledraar.gmail.com/ should might catch this, i.e. the "could not copy" error.
diff --git a/README b/README index 8b13789..1f7391f 100644 --- a/README +++ b/README @@ -1 +1 @@ - +master commit cfb5d5cd9f28e1dcca7a1d1088405d8ec4ebf713 Author: sylvain.bentz <sylvain.bentz@md6.fr> Date: Wed Jul 21 14:49:36 2021 +0200 First commit diff --git a/README b/README new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/README @@ -0,0 +1 @@ + /git-min # mer + mer + set -x + git merge conflict Auto-merging README CONFLICT (content): Merge conflict in README Recorded preimage for 'README' Automatic merge failed; fix conflicts and then commit the result. /git-min # del = '>' + del '=' '>' + set -x + sed -i '/=/ d' README + sed -i '/>/ d' README + cat README <<<<<<< HEAD master conflict /git-min # com merge + com merge + set -x + git add README + git commit -m merge error: could not parse conflict hunks in 'README' error: could not parse conflict hunks in 'README' Recorded preimage for 'README' [master ab6c525] merge /git-min # del '<' + del '<' + set -x + sed -i '/</ d' README + cat README master conflict /git-min # com mergefix + com mergefix + set -x + git add README + git commit -m mergefix Segmentation fault /git-min # see + see + set -x + git log -p -n2 commit 8ea1a55602ba5ae505b43f2ae3a49b3a9a26b2fe (HEAD -> master) Author: Your Name <you@example.com> Date: Wed Jul 21 15:38:35 2021 +0000 mergefix diff --git a/README b/README index 59c1bc9..6ecc231 100644 --- a/README +++ b/README @@ -1,3 +1,2 @@ -<<<<<<< HEAD master conflict