git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] assertion failure when merging branches
@ 2021-12-27 18:34 Ralf Thielow
  2021-12-27 22:15 ` Elijah Newren
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Thielow @ 2021-12-27 18:34 UTC (permalink / raw)
  To: git; +Cc: newren

Hi,

At $WORK I tried to merge two branches and ran into an assertion
failure. I exported the two branches down to the merge base as
an anonymous repo, so that it can be reproduced.

In the branch I tried to merge into, files have been moved
and/or reformatted.

My Git version is 2.34.1.

wget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt
mkdir tmp
cd tmp
git init
cat ../repo.txt | git fast-import
git checkout ref0/ref1
git config merge.renormalize true
git merge ref2/ref0/ref3

git: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&
!ci->path_conflict' failed.
Aborted (core dumped)

Ciao,
Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG?] assertion failure when merging branches
  2021-12-27 18:34 [BUG?] assertion failure when merging branches Ralf Thielow
@ 2021-12-27 22:15 ` Elijah Newren
  2021-12-28  0:30   ` Elijah Newren
  0 siblings, 1 reply; 3+ messages in thread
From: Elijah Newren @ 2021-12-27 22:15 UTC (permalink / raw)
  To: Ralf Thielow; +Cc: git

On Mon, Dec 27, 2021 at 10:35 AM Ralf Thielow <ralf.thielow@gmail.com> wrote:
>
> Hi,
>
> At $WORK I tried to merge two branches and ran into an assertion
> failure. I exported the two branches down to the merge base as
> an anonymous repo, so that it can be reproduced.
>
> In the branch I tried to merge into, files have been moved
> and/or reformatted.
>
> My Git version is 2.34.1.
>
> wget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt
> mkdir tmp
> cd tmp
> git init
> cat ../repo.txt | git fast-import
> git checkout ref0/ref1
> git config merge.renormalize true
> git merge ref2/ref0/ref3
>
> git: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&
> !ci->path_conflict' failed.
> Aborted (core dumped)

Yikes, sorry about this renormalization bug in merge-ort.  For now,
you can recover via:

  $ rm .git/index.lock
  $ rm .git/MERGE_*

and then as a workaround you can either use the old merge backend for now:

  $ git config pull.twohead recursive

or continue using the new merge backend and just turn off
merge.renormalize.  After that, a subsequent `git merge
ref2/ref0/ref3` should work for you.


As for the bug, I introduced this in commit a492d5331c ("merge-ort:
ensure we consult df_conflict and path_conflicts", 2021-06-30), and
before that commit, this type of setup would be mis-merged (with a
rename/delete conflict getting ignored).  I'll submit a patch with a
smaller testcase soon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG?] assertion failure when merging branches
  2021-12-27 22:15 ` Elijah Newren
@ 2021-12-28  0:30   ` Elijah Newren
  0 siblings, 0 replies; 3+ messages in thread
From: Elijah Newren @ 2021-12-28  0:30 UTC (permalink / raw)
  To: Ralf Thielow; +Cc: git

On Mon, Dec 27, 2021 at 2:15 PM Elijah Newren <newren@gmail.com> wrote:
>
> On Mon, Dec 27, 2021 at 10:35 AM Ralf Thielow <ralf.thielow@gmail.com> wrote:
> >
> > Hi,
> >
> > At $WORK I tried to merge two branches and ran into an assertion
> > failure. I exported the two branches down to the merge base as
> > an anonymous repo, so that it can be reproduced.
> >
> > In the branch I tried to merge into, files have been moved
> > and/or reformatted.
> >
> > My Git version is 2.34.1.
> >
> > wget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt
> > mkdir tmp
> > cd tmp
> > git init
> > cat ../repo.txt | git fast-import
> > git checkout ref0/ref1
> > git config merge.renormalize true
> > git merge ref2/ref0/ref3
> >
> > git: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&
> > !ci->path_conflict' failed.
> > Aborted (core dumped)
>
> Yikes, sorry about this renormalization bug in merge-ort.
...
> I'll submit a patch with a smaller testcase soon.

For those wanting to follow along; fix submitted over here:
https://lore.kernel.org/git/pull.1174.git.git.1640650846612.gitgitgadget@gmail.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-28  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 18:34 [BUG?] assertion failure when merging branches Ralf Thielow
2021-12-27 22:15 ` Elijah Newren
2021-12-28  0:30   ` Elijah Newren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).