{"thread":{"id":"2419","subject":"Strange merge conflicts against earlier merge.","startedAt":"2005-11-10T00:38:35Z","lastAt":"2005-11-12T00:50:41Z","messageCount":13,"participants":["Martin Langhoff","Petr Baudis","Fredrik Kuivinen","Junio C Hamano","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11447","messageId":"46a038f90511091638k726d605r170717539225a712@mail.gmail.com","threadId":"2419","inReplyTo":null,"subject":"Strange merge conflicts against earlier merge.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-11-10T00:38:35Z","receivedAt":"2005-11-10T00:38:35Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"We are working with a series of closely related heads, and merging\namong them. I am sometimes finding merge conflicts that I don't think\nI should be seeing. Assuming two branches, 'local' and 'remote', where\nlocal has with remote before (*), and I have no conflicting changes in\nlocal...\n\n 1 - pull and merge from remote. The merge touches file A, B and C\n 2 - on local, develop on unrelated files O,P,Q, commit\n 3 - pull and merge from remote. The merge touches file B, C and D. I\nam sometimes seeing conflicts on file B and C, which was never touched\non local.\n\n* - In the case i have, the ancestry before the merge is a bit\nconvoluted. AFAIK, this shouldn't affect us going forward. Both\nbranches have a common ancestor, though, and are now merging often\nfrom remote to local.\n\nWe are using cogito for this, although on step 3 I have also tested\nwith git-merge.sh and I get the same result.  It could still be a\nproblem related to how the merge on step 1 is recording the merge.\n\nFor an example, clone\nhttp://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\nregister also the\nhttp://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\ntwo heads:\n\n master: 214e6374d49e6d014f0ba6f159d585a3fe468909\n remote: 05059be73c9e09e22b98bc796be35c595e551ed6\n\nOn git-merge 'testing merge' master remote you'll see conflicts over\nmod/quiz/editlib.php -- doing the same with cg-merge gets an\nadditional conflict on mod/quiz/export.php. Neither of those files\nwere ever modified on local -- however, both merges brought in changes\nto the same lines of code.\n\nI suspect this is because the merge itself is being considered a\ncommit on the local branch. Fair enough -- git has no way of ensuring\nthat I haven't slipped in a few changes of mine in the merge. OTOH,\nit's pretty unexpected to see this on files that are not one char\ndifferent from the 'remote' branch. Am I doing something wrong?\n\ncheers,\n\n\nmartin\n"},{"id":"11469","messageId":"20051110102043.GQ30496@pasky.or.cz","threadId":"2419","inReplyTo":"46a038f90511091638k726d605r170717539225a712@mail.gmail.com","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-10T10:20:43Z","receivedAt":"2005-11-10T10:20:43Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Nov 10, 2005 at 01:38:35AM CET, I got a letter\nwhere Martin Langhoff <martin.langhoff@gmail.com> said that...\n> We are working with a series of closely related heads, and merging\n> among them. I am sometimes finding merge conflicts that I don't think\n> I should be seeing. Assuming two branches, 'local' and 'remote', where\n> local has with remote before (*), and I have no conflicting changes in\n> local...\n> \n>  1 - pull and merge from remote. The merge touches file A, B and C\n>  2 - on local, develop on unrelated files O,P,Q, commit\n>  3 - pull and merge from remote. The merge touches file B, C and D. I\n> am sometimes seeing conflicts on file B and C, which was never touched\n> on local.\n\nInteresting. Could you check what the merge base is?\n\n\tgit-merge-base local remote\n\nIt should be the merge from (1).\n\n> For an example, clone\n> http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\n> register also the\n> http://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\n> two heads:\n\nCould you please run git-update-server-info over there?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11545","messageId":"46a038f90511102040n3e251252rce54117c51ce0429@mail.gmail.com","threadId":"2419","inReplyTo":"20051110102043.GQ30496@pasky.or.cz","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-11-11T04:40:05Z","receivedAt":"2005-11-11T04:40:05Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 11/10/05, Petr Baudis <pasky@suse.cz> wrote:\n> Interesting. Could you check what the merge base is?\n>\n>         git-merge-base local remote\n>\n> It should be the merge from (1).\n\nIt seems to be actually one of the parents, not the merge itself.\n\n> > For an example, clone\n> > http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\n> > register also the\n> > http://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\n> > two heads:\n>\n> Could you please run git-update-server-info over there?\n\nShould be fixed now...\n\ncheers,\n\n\nmartin\n"},{"id":"11562","messageId":"20051111075257.GA4765@c165.ib.student.liu.se","threadId":"2419","inReplyTo":"46a038f90511091638k726d605r170717539225a712@mail.gmail.com","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Fredrik Kuivinen","fromEmail":"freku045@student.liu.se","sentAt":"2005-11-11T07:52:57Z","receivedAt":"2005-11-11T07:52:57Z","isPatch":false,"sender":{"key":"frekui@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13770967?v=4"},"body":"On Thu, Nov 10, 2005 at 01:38:35PM +1300, Martin Langhoff wrote:\n> We are working with a series of closely related heads, and merging\n> among them. I am sometimes finding merge conflicts that I don't think\n> I should be seeing. Assuming two branches, 'local' and 'remote', where\n> local has with remote before (*), and I have no conflicting changes in\n> local...\n> \n>  1 - pull and merge from remote. The merge touches file A, B and C\n>  2 - on local, develop on unrelated files O,P,Q, commit\n>  3 - pull and merge from remote. The merge touches file B, C and D. I\n> am sometimes seeing conflicts on file B and C, which was never touched\n> on local.\n> \n> * - In the case i have, the ancestry before the merge is a bit\n> convoluted. AFAIK, this shouldn't affect us going forward. Both\n> branches have a common ancestor, though, and are now merging often\n> from remote to local.\n> \n> We are using cogito for this, although on step 3 I have also tested\n> with git-merge.sh and I get the same result.  It could still be a\n> problem related to how the merge on step 1 is recording the merge.\n> \n> For an example, clone\n> http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\n> register also the\n> http://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\n> two heads:\n> \n>  master: 214e6374d49e6d014f0ba6f159d585a3fe468909\n>  remote: 05059be73c9e09e22b98bc796be35c595e551ed6\n> \n> On git-merge 'testing merge' master remote you'll see conflicts over\n> mod/quiz/editlib.php -- doing the same with cg-merge gets an\n> additional conflict on mod/quiz/export.php. Neither of those files\n> were ever modified on local -- however, both merges brought in changes\n> to the same lines of code.\n> \n> I suspect this is because the merge itself is being considered a\n> commit on the local branch. Fair enough -- git has no way of ensuring\n> that I haven't slipped in a few changes of mine in the merge. OTOH,\n> it's pretty unexpected to see this on files that are not one char\n> different from the 'remote' branch. Am I doing something wrong?\n> \n\nThis merge has two common ancestors, \n\n    $ git-merge-base --all master remote\n    3b12fc6420c26a6556c2d806fca79dd96e8e22b9\n    2163a9076d9515f00494ba9df7dbc85c9804790f\n\nThis may explain the results you get with cg-merge, as that script\nseems to use 'git-merge-base' without the '--all' flag.\n\nIt really seems to be the case that there is a real conflict in\nmod/quiz/editlib.php, this can be visualized nicely with\n\n    gitk master remote -- mod/quiz/editlib.php\n\n\n- Fredrik\n"},{"id":"11579","messageId":"20051111113546.GP30496@pasky.or.cz","threadId":"2419","inReplyTo":"46a038f90511102040n3e251252rce54117c51ce0429@mail.gmail.com","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-11T11:35:46Z","receivedAt":"2005-11-11T11:35:46Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 11, 2005 at 05:40:05AM CET, I got a letter\nwhere Martin Langhoff <martin.langhoff@gmail.com> said that...\n> On 11/10/05, Petr Baudis <pasky@suse.cz> wrote:\n> > > For an example, clone\n> > > http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\n> > > register also the\n> > > http://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\n> > > two heads:\n> >\n> > Could you please run git-update-server-info over there?\n> \n> Should be fixed now...\n\nI still have trouble cloning:\n\n$ cg-clone http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti\ndefaulting to local storage area\nwarning: templates not found /home/xpasky/share/git-core/templates/\n12:13:31 URL:http://locke.catalyst.net.nz/git/moodle.git/refs/heads/mdl-artena-tairawhiti [41/41] -> \".git/refs/heads/.origin-fetching\" [1]\nprogress: 3 objects, 860 bytes\nGetting alternates list\nprogress: 4 objects, 1934 bytes\nGetting pack list\nprogress: 19 objects, 12532 bytes\nerror: The requested URL returned error: 404\nerror: Unable to find 214e6374d49e6d014f0ba6f159d585a3fe468909 under\nhttp://locke.catalyst.net.nz/git/moodle.git/\n\nCannot obtain needed commit 214e6374d49e6d014f0ba6f159d585a3fe468909\nwhile processing commit 6d32aa8241387e58ffd0e18862114add0d20d686.\ncg-fetch: objects fetch failed\ncg-clone: fetch failed\n\n\nPS: Do I understand it right that git-clone can't clone just a single\nhead?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11580","messageId":"20051111114511.GQ30496@pasky.or.cz","threadId":"2419","inReplyTo":"20051111075257.GA4765@c165.ib.student.liu.se","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-11T11:45:11Z","receivedAt":"2005-11-11T11:45:11Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 11, 2005 at 08:52:57AM CET, I got a letter\nwhere Fredrik Kuivinen <freku045@student.liu.se> said that...\n> On Thu, Nov 10, 2005 at 01:38:35PM +1300, Martin Langhoff wrote:\n> > We are working with a series of closely related heads, and merging\n> > among them. I am sometimes finding merge conflicts that I don't think\n> > I should be seeing. Assuming two branches, 'local' and 'remote', where\n> > local has with remote before (*), and I have no conflicting changes in\n> > local...\n> > \n> >  1 - pull and merge from remote. The merge touches file A, B and C\n> >  2 - on local, develop on unrelated files O,P,Q, commit\n> >  3 - pull and merge from remote. The merge touches file B, C and D. I\n> > am sometimes seeing conflicts on file B and C, which was never touched\n> > on local.\n> > \n> > * - In the case i have, the ancestry before the merge is a bit\n> > convoluted. AFAIK, this shouldn't affect us going forward. Both\n> > branches have a common ancestor, though, and are now merging often\n> > from remote to local.\n> > \n> > We are using cogito for this, although on step 3 I have also tested\n> > with git-merge.sh and I get the same result.  It could still be a\n> > problem related to how the merge on step 1 is recording the merge.\n> > \n> > For an example, clone\n> > http://locke.catalyst.net.nz/git/moodle.git#mdl-artena-tairawhiti and\n> > register also the\n> > http://locke.catalyst.net.nz/git/moodle.git#mdl-local branch. Create\n> > two heads:\n> > \n> >  master: 214e6374d49e6d014f0ba6f159d585a3fe468909\n> >  remote: 05059be73c9e09e22b98bc796be35c595e551ed6\n> > \n> > On git-merge 'testing merge' master remote you'll see conflicts over\n> > mod/quiz/editlib.php -- doing the same with cg-merge gets an\n> > additional conflict on mod/quiz/export.php. Neither of those files\n> > were ever modified on local -- however, both merges brought in changes\n> > to the same lines of code.\n> > \n> > I suspect this is because the merge itself is being considered a\n> > commit on the local branch. Fair enough -- git has no way of ensuring\n> > that I haven't slipped in a few changes of mine in the merge. OTOH,\n> > it's pretty unexpected to see this on files that are not one char\n> > different from the 'remote' branch. Am I doing something wrong?\n> > \n> \n> This merge has two common ancestors, \n> \n>     $ git-merge-base --all master remote\n>     3b12fc6420c26a6556c2d806fca79dd96e8e22b9\n>     2163a9076d9515f00494ba9df7dbc85c9804790f\n> \n> This may explain the results you get with cg-merge, as that script\n> seems to use 'git-merge-base' without the '--all' flag.\n\nHmm. So what should I do with that? :-)\n\nI wondered about adding multi-base merge support to Cogito, but it seems\nto be a bit funny, and totally undocumented. Especially, is it right\nthat I would end up with _four_ stages in case of two-base \"three\"-way\nmerge? That would mean complete rewrite of the one-file merger, right?\nAnd it seems git-merge-index would overflow and crash. :-)\n\nI guess I really don't want to do that, but instead choose one of the\nbases. Hmm. Well, I suppose it's as good as anything to leave this\ndecision on the user. Kind of:\n\n\tif [ $(wc -l merge-bases) -ge 1 ]; then\n\t\techo \"Multiple merge bases, please select one by the -b parameter:\" >&2\n\t\tcat merge-bases\n\t\techo -n \"The most conservative base (but likely a lot of conflicts):\" >&2\n\t\twhile true; do\n\t\t\tgit-merge-base --all $(cat merge-bases) >merge-bases~\n\t\t\tmv merge-bases~ merge-bases\n\t\t\t[ $(wc -l merge-bases) -eq 1 ] && break\n\t\tdone\n\t\tcat merge-bases\n\t\texit 1\n\tfi\n\nDoes core GIT have support for multibase merges, except for the\nrecursive merge strategy? How do you do it?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11585","messageId":"20051111131200.GS30496@pasky.or.cz","threadId":"2419","inReplyTo":"20051111114511.GQ30496@pasky.or.cz","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-11T13:12:00Z","receivedAt":"2005-11-11T13:12:00Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 11, 2005 at 12:45:11PM CET, I got a letter\nwhere Petr Baudis <pasky@suse.cz> said that...\n> I guess I really don't want to do that, but instead choose one of the\n> bases. Hmm. Well, I suppose it's as good as anything to leave this\n> decision on the user. Kind of:\n> \n> \tif [ $(wc -l merge-bases) -ge 1 ]; then\n> \t\techo \"Multiple merge bases, please select one by the -b parameter:\" >&2\n> \t\tcat merge-bases\n> \t\techo -n \"The most conservative base (but likely a lot of conflicts):\" >&2\n> \t\twhile true; do\n> \t\t\tgit-merge-base --all $(cat merge-bases) >merge-bases~\n> \t\t\tmv merge-bases~ merge-bases\n> \t\t\t[ $(wc -l merge-bases) -eq 1 ] && break\n> \t\tdone\n> \t\tcat merge-bases\n> \t\texit 1\n> \tfi\n\nI just did something in this style. Since I'm unable to get the\nrepository, could someone please test it?\n\nI'll try to come up with some automated testcase later.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11609","messageId":"7v64qzozyx.fsf@assigned-by-dhcp.cox.net","threadId":"2419","inReplyTo":"20051111114511.GQ30496@pasky.or.cz","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-11T17:29:10Z","receivedAt":"2005-11-11T17:29:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> Does core GIT have support for multibase merges, except for the\n> recursive merge strategy? How do you do it?\n\nThere were lengthy discussion on this and a lot of work that\nwent into the resolution.  We do three things.\n\n - The first implementation does a trial read-tree 3-way using\n   each of the base candidates without smudging the working\n   tree, and counts paths that need file-level merges, to guess\n   the best base, and uses that base.  This is in the 'stupid'\n   stratagy.\n\n - The above turned out to have a risky corner case, especially\n   when one side reverted a patch and the other one did not.  To\n   address this, read-tree was rewritten and 3-way form of\n   read-tree can take more than three trees these days, letting\n   you feed it all the merge base candidates.  This code is used\n   in 'resolve' strategy.\n\n - The 'recursive' strategy tries to come up with a merge of the\n   candidate bases and uses it as the base of the final merge.\n"},{"id":"11610","messageId":"20051111173239.GU16061@pasky.or.cz","threadId":"2419","inReplyTo":"7v64qzozyx.fsf@assigned-by-dhcp.cox.net","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-11T17:32:39Z","receivedAt":"2005-11-11T17:32:39Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 11, 2005 at 06:29:10PM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n>  - The above turned out to have a risky corner case, especially\n>    when one side reverted a patch and the other one did not.  To\n>    address this, read-tree was rewritten and 3-way form of\n>    read-tree can take more than three trees these days, letting\n>    you feed it all the merge base candidates.  This code is used\n>    in 'resolve' strategy.\n\nYes, but what I didn't find out is whether the additional trees result\nin additional stages, what are the trivial merging rules, how does it\nplay together with git-merge-index, etc. Doesn't seem to be documented\neither.\n\nThanks,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11629","messageId":"20051111215620.GX16061@pasky.or.cz","threadId":"2419","inReplyTo":"7v1x1nni78.fsf@assigned-by-dhcp.cox.net","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-11-11T21:56:20Z","receivedAt":"2005-11-11T21:56:20Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 11, 2005 at 07:38:19PM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Petr Baudis <pasky@suse.cz> writes:\n> > Yes, but what I didn't find out is whether the additional trees result\n> > in additional stages, what are the trivial merging rules, how does it\n> > play together with git-merge-index, etc. Doesn't seem to be documented\n> > either.\n> \n> Documentation/technical/ perhaps?\n\nThis contains the merge resolution tables, which is very useful - thanks\nfor that.\n\nHowever, it still doesn't seem to answer my question - do the additional\ntrees result in additional stages? Let's take e.g.:\n\n\t16    anc1/anc2 anc1    anc2      no merge\n\nWhat ends up in the index at this moment as \"stage 1\"? anc1? anc2?\nTwo stage 1 entries? And what does git-merge-index do about this?\n\nThanks,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"11631","messageId":"7vy83ukdwf.fsf@assigned-by-dhcp.cox.net","threadId":"2419","inReplyTo":"20051111215620.GX16061@pasky.or.cz","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-11T22:39:28Z","receivedAt":"2005-11-11T22:39:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@ucw.cz> writes:\n\n> \t16    anc1/anc2 anc1    anc2      no merge\n>\n> What ends up in the index at this moment as \"stage 1\"? anc1? anc2?\n> Two stage 1 entries? And what does git-merge-index do about this?\n\nI think we decided there is no single sensible resolution, and\nwe leave stage 1 empty.\n\nCome to think of it, we should signal that we are punting by\neither exiting non-zero, or stuffing 0{40} SHA1 in stage1, so\nthat we can distinguish the case with two sides adding things\ndifferently.  Daniel, what do you think?\n"},{"id":"11637","messageId":"Pine.LNX.4.64.0511111806070.25300@iabervon.org","threadId":"2419","inReplyTo":"7vy83ukdwf.fsf@assigned-by-dhcp.cox.net","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-11-11T23:33:28Z","receivedAt":"2005-11-11T23:33:28Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 11 Nov 2005, Junio C Hamano wrote:\n\n> Petr Baudis <pasky@ucw.cz> writes:\n> \n> > \t16    anc1/anc2 anc1    anc2      no merge\n> >\n> > What ends up in the index at this moment as \"stage 1\"? anc1? anc2?\n> > Two stage 1 entries? And what does git-merge-index do about this?\n> \n> I think we decided there is no single sensible resolution, and\n> we leave stage 1 empty.\n> \n> Come to think of it, we should signal that we are punting by\n> either exiting non-zero, or stuffing 0{40} SHA1 in stage1, so\n> that we can distinguish the case with two sides adding things\n> differently.  Daniel, what do you think?\n\nProbably don't want to exit non-zero, since we can deal with the rest of \nthe paths sensibly. All 0 SHA1 would work, if we want to identify this \ncase. On the other hand, I think the desired behavior at present is to \ntell the user to pick the correct version of the two, which is the same as \nif it's new in both sides, which is why I had it like that.\n\nSomeday, we ought to do a combined merge-base and read-tree, which would \nbe able to correctly handle revert wars, but it's too very exciting \ncurrently, since the multi-base merge cases have generally turned out to \nbe user error (i.e., the user didn't actually mean to merge those things).\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"11643","messageId":"7v1x1mk7tq.fsf@assigned-by-dhcp.cox.net","threadId":"2419","inReplyTo":"Pine.LNX.4.64.0511111806070.25300@iabervon.org","subject":"Re: Strange merge conflicts against earlier merge.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-12T00:50:41Z","receivedAt":"2005-11-12T00:50:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Fri, 11 Nov 2005, Junio C Hamano wrote:\n>\n>> Come to think of it, we should signal that we are punting by\n>> either exiting non-zero, or stuffing 0{40} SHA1 in stage1, so\n>> that we can distinguish the case with two sides adding things\n>> differently.  Daniel, what do you think?\n>\n> Probably don't want to exit non-zero, since we can deal with the rest of \n> the paths sensibly. All 0 SHA1 would work, if we want to identify this \n> case. On the other hand, I think the desired behavior at present is to \n> tell the user to pick the correct version of the two, which is the same as \n> if it's new in both sides, which is why I had it like that.\n\nYeah, and I have an updated merge-one-file in \"pu\" that tries to\ndo a bit more interesting thing than just punting and asking the\nuser, when both sides added different contents.  I did not want\nto trigger that logic when we are doing case #16, and that was\nwhat my comment was about.\n"}]}