{"thread":{"id":"57156","subject":"[BUG?] assertion failure when merging branches","startedAt":"2021-12-27T18:35:10Z","lastAt":"2021-12-28T00:31:06Z","messageCount":3,"participants":["Ralf Thielow","Elijah Newren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"445006","messageId":"CAN0XMOK8iHZnbtYw7CPAQGJcmuVSDxQoFNFEwiaa41V89F1rzA@mail.gmail.com","threadId":"57156","inReplyTo":null,"subject":"[BUG?] assertion failure when merging branches","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2021-12-27T18:34:30Z","receivedAt":"2021-12-27T18:35:10Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"Hi,\n\nAt $WORK I tried to merge two branches and ran into an assertion\nfailure. I exported the two branches down to the merge base as\nan anonymous repo, so that it can be reproduced.\n\nIn the branch I tried to merge into, files have been moved\nand/or reformatted.\n\nMy Git version is 2.34.1.\n\nwget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt\nmkdir tmp\ncd tmp\ngit init\ncat ../repo.txt | git fast-import\ngit checkout ref0/ref1\ngit config merge.renormalize true\ngit merge ref2/ref0/ref3\n\ngit: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&\n!ci->path_conflict' failed.\nAborted (core dumped)\n\nCiao,\nRalf\n"},{"id":"445017","messageId":"CABPp-BH=nqeqpW8Grn+6No4HvRaBaC9spwEsDcj1BWdsipJh=Q@mail.gmail.com","threadId":"57156","inReplyTo":"CAN0XMOK8iHZnbtYw7CPAQGJcmuVSDxQoFNFEwiaa41V89F1rzA@mail.gmail.com","subject":"Re: [BUG?] assertion failure when merging branches","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-12-27T22:15:25Z","receivedAt":"2021-12-27T22:15:40Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Dec 27, 2021 at 10:35 AM Ralf Thielow <ralf.thielow@gmail.com> wrote:\n>\n> Hi,\n>\n> At $WORK I tried to merge two branches and ran into an assertion\n> failure. I exported the two branches down to the merge base as\n> an anonymous repo, so that it can be reproduced.\n>\n> In the branch I tried to merge into, files have been moved\n> and/or reformatted.\n>\n> My Git version is 2.34.1.\n>\n> wget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt\n> mkdir tmp\n> cd tmp\n> git init\n> cat ../repo.txt | git fast-import\n> git checkout ref0/ref1\n> git config merge.renormalize true\n> git merge ref2/ref0/ref3\n>\n> git: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&\n> !ci->path_conflict' failed.\n> Aborted (core dumped)\n\nYikes, sorry about this renormalization bug in merge-ort.  For now,\nyou can recover via:\n\n  $ rm .git/index.lock\n  $ rm .git/MERGE_*\n\nand then as a workaround you can either use the old merge backend for now:\n\n  $ git config pull.twohead recursive\n\nor continue using the new merge backend and just turn off\nmerge.renormalize.  After that, a subsequent `git merge\nref2/ref0/ref3` should work for you.\n\n\nAs for the bug, I introduced this in commit a492d5331c (\"merge-ort:\nensure we consult df_conflict and path_conflicts\", 2021-06-30), and\nbefore that commit, this type of setup would be mis-merged (with a\nrename/delete conflict getting ignored).  I'll submit a patch with a\nsmaller testcase soon.\n"},{"id":"445037","messageId":"CABPp-BGLMkqQs1ncT_EmPYjEo-GRV_qibx7EYSYL-wME3Exa5g@mail.gmail.com","threadId":"57156","inReplyTo":"CABPp-BH=nqeqpW8Grn+6No4HvRaBaC9spwEsDcj1BWdsipJh=Q@mail.gmail.com","subject":"Re: [BUG?] assertion failure when merging branches","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-12-28T00:30:51Z","receivedAt":"2021-12-28T00:31:06Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Dec 27, 2021 at 2:15 PM Elijah Newren <newren@gmail.com> wrote:\n>\n> On Mon, Dec 27, 2021 at 10:35 AM Ralf Thielow <ralf.thielow@gmail.com> wrote:\n> >\n> > Hi,\n> >\n> > At $WORK I tried to merge two branches and ran into an assertion\n> > failure. I exported the two branches down to the merge base as\n> > an anonymous repo, so that it can be reproduced.\n> >\n> > In the branch I tried to merge into, files have been moved\n> > and/or reformatted.\n> >\n> > My Git version is 2.34.1.\n> >\n> > wget https://gist.github.com/ralfth/5b624abb0a99e3e705a0984c4b2d253e/raw/7f7ef5b10711550b90342c50b53ce25c19075c97/repo.txt\n> > mkdir tmp\n> > cd tmp\n> > git init\n> > cat ../repo.txt | git fast-import\n> > git checkout ref0/ref1\n> > git config merge.renormalize true\n> > git merge ref2/ref0/ref3\n> >\n> > git: merge-ort.c:3846: process_entry: Assertion `!ci->df_conflict &&\n> > !ci->path_conflict' failed.\n> > Aborted (core dumped)\n>\n> Yikes, sorry about this renormalization bug in merge-ort.\n...\n> I'll submit a patch with a smaller testcase soon.\n\nFor those wanting to follow along; fix submitted over here:\nhttps://lore.kernel.org/git/pull.1174.git.git.1640650846612.gitgitgadget@gmail.com/\n"}]}