{"thread":{"id":"31269","subject":"\"Temporary merge branch 2\" Conflicts","startedAt":"2012-08-17T13:48:45Z","lastAt":"2012-08-20T13:21:41Z","messageCount":4,"participants":["Stephen Bash","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"197181","messageId":"1972858401.161319.1345211324976.JavaMail.root@genarts.com","threadId":"31269","inReplyTo":"73388252.160741.1345208957127.JavaMail.root@genarts.com","subject":"\"Temporary merge branch 2\" Conflicts","fromName":"Stephen Bash","fromEmail":"bash@genarts.com","sentAt":"2012-08-17T13:48:45Z","receivedAt":"2012-08-17T13:48:45Z","isPatch":false,"sender":{"key":"bash@genarts.com","avatar":null},"body":"Hi all-\n\nGiven this branch history:\n\n ---------M------M---M-------> dev\n     \\   /      /   /\n      --------------           v1-maint\n            \\   \\   \\\n             ----M---M-------> v1.5-maint\n\nI am attempting to merge v1.5-maint into dev.  There are some expected conflicts, but when I start mergetool (kdiff3) there are also a lot of conflict markers in the base that look like this\n\n<<<<<<< Temporary merge branch 1\n    ... code here ...\n=======\n    ... more code here ...\n>>>>>>> Temporary merge branch 2\n\nwhich confuse kdiff3.  Googling around I found a few mentions of these temporary merge branches, e.g. $gmane/157591, but I don't think we have any criss-cross merges.  Can anyone provide some advice?\n\nAny suggestions are greatly appreciated!\n\nThanks,\nStephen\n"},{"id":"197231","messageId":"732986549.167685.1345236990359.JavaMail.root@genarts.com","threadId":"31269","inReplyTo":"1972858401.161319.1345211324976.JavaMail.root@genarts.com","subject":"Re: \"Temporary merge branch 2\" Conflicts","fromName":"Stephen Bash","fromEmail":"bash@genarts.com","sentAt":"2012-08-17T20:56:30Z","receivedAt":"2012-08-17T20:56:30Z","isPatch":false,"sender":{"key":"bash@genarts.com","avatar":null},"body":"----- Original Message -----\n> From: \"Stephen Bash\" <bash@genarts.com>\n> Sent: Friday, August 17, 2012 9:48:45 AM\n> Subject: \"Temporary merge branch 2\" Conflicts\n> \n> Given this branch history:\n> \n>  ---------M------M---M-------> dev\n>      \\   /      /   /\n>       --------------           v1-maint\n>             \\   \\   \\\n>              ----M---M-------> v1.5-maint\n> \n> I am attempting to merge v1.5-maint into dev.\n\nTurns out (not surprisingly) the graph is not that simple.  I have multiple (disjoint) merge bases:\n\n  $ git merge-base --all dev v1.5-maint \n  ad9ed6c207fba9419b10a394e3721333d0d73e81\n  5ff4cb0927188fb7246a0eff22d7ffed1a91fe2d\n  $ git rev-list --ancestry-path 5ff4cb0..ad9ed6c\n  $\n\nA little investigation of 5ff4cb0 shows the branch structure looks more like:\n\n       A-----C---------> v1-maint\n      /      |\\\n ----o       | \\\n      \\      |  \\\n       B     |   \\\n       |\\    |    \\\n ------|-M---|-----M---> v1.5-maint\n       |     |\n ------M-----M---------> dev\n\nB is 5ff4cb0 and C is ad9ed6c (with several months and commits separating them).  A and B are tree-same (the only difference is the commit time and the log message).  Again, I'm attempting to merge v1.5-maint into dev.\n\n> Googling around I found a few mentions of these temporary merge\n> branches, e.g. $gmane/157591, but I don't think we have any\n> criss-cross merges.\n\nAnd now I'm convinced I do have some form of degenerate merge case.  I made several attempts to dig myself out of this hole, but failed.  \n\nWhat is the recommended method for resolving this sort of merge?  kdiff3 obviously doesn't understand the situation.  Do the working tree files contain all the conflicts?  If so, I can just go through by hand and resolve the conflicts the old fashion way.\n\nSeparately, is mergetool passing the correct base file to the external tool if I'm seeing \"Temporary merge branch\" conflicts in it?  (I'm using git 1.7.11.4)\n\nThanks!\nStephen\n"},{"id":"197232","messageId":"7vfw7lteaw.fsf@alter.siamese.dyndns.org","threadId":"31269","inReplyTo":"732986549.167685.1345236990359.JavaMail.root@genarts.com","subject":"Re: \"Temporary merge branch 2\" Conflicts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-17T21:10:47Z","receivedAt":"2012-08-17T21:10:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Bash <bash@genarts.com> writes:\n\n> What is the recommended method for resolving this sort of merge?\n> kdiff3 obviously doesn't understand the situation.  Do the working\n> tree files contain all the conflicts?  If so, I can just go\n> through by hand and resolve the conflicts the old fashion way.\n\nYes.  External tools like kdiff3 may not understand the conflict in\nthe working tree, but the files in the working tree should have\nresolved the naturally resolvable bits and only left the conflicted\nbits conflicted.  Just resolve manually if you can, and then look at\nwhat both branches wanted to do to the file (\"git log -p --merge\n$that_path\" before you \"git add\" as the final sanity check would\nwork nicely) to make sure your resolution makes sense.\n"},{"id":"197404","messageId":"1666100271.191032.1345468901838.JavaMail.root@genarts.com","threadId":"31269","inReplyTo":"7vfw7lteaw.fsf@alter.siamese.dyndns.org","subject":"Re: \"Temporary merge branch 2\" Conflicts","fromName":"Stephen Bash","fromEmail":"bash@genarts.com","sentAt":"2012-08-20T13:21:41Z","receivedAt":"2012-08-20T13:21:41Z","isPatch":false,"sender":{"key":"bash@genarts.com","avatar":null},"body":"----- Original Message -----\n> From: \"Junio C Hamano\" <gitster@pobox.com>\n> Sent: Friday, August 17, 2012 5:10:47 PM\n> Subject: Re: \"Temporary merge branch 2\" Conflicts\n> \n> Stephen Bash <bash@genarts.com> writes:\n> \n> > What is the recommended method for resolving this sort of merge?\n> > kdiff3 obviously doesn't understand the situation.  Do the working\n> > tree files contain all the conflicts?  If so, I can just go\n> > through by hand and resolve the conflicts the old fashion way.\n> \n> Yes.  External tools like kdiff3 may not understand the conflict in\n> the working tree, but the files in the working tree should have\n> resolved the naturally resolvable bits and only left the conflicted\n> bits conflicted.  Just resolve manually if you can, and then look at\n> what both branches wanted to do to the file (\"git log -p --merge\n> $that_path\" before you \"git add\" as the final sanity check would\n> work nicely) to make sure your resolution makes sense.\n\nThanks for the clarification Junio.  I'll take another swipe at it this week now that I know what I'm doing!\n\nStephen\n"}]}