{"thread":{"id":"24636","subject":"git merge - \"both added\" conflict resolution","startedAt":"2010-08-04T20:18:30Z","lastAt":"2010-08-06T14:57:07Z","messageCount":6,"participants":["Eugene Sajine","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"147132","messageId":"AANLkTi=Hp6DsE75XbgehS2bucp-M9NXmGgYbvw0kp6j8@mail.gmail.com","threadId":"24636","inReplyTo":null,"subject":"git merge - \"both added\" conflict resolution","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-08-04T20:18:30Z","receivedAt":"2010-08-04T20:18:30Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"hi,\n\nI'm trying to merge two projects into one. Both are having different\nand simple set of files inside, but both have build.xml file.\nLet's say i have source repo with master branch and dest repo.\n\nWhen i'm trying to merge source into dest it all goes well with an\nexception of the build.xml file - it has conflict. The conflict is one\nliner and is easy to resolve, eventually i want it to be as it was\nbefore the merge.\nFirst of all, after the merge git status gives me message \"both added;\nbuild.xml\" not both modified, which is understandable, but i have no\nclue yet how to work with it;)\n\nSecondly, when i resolve the conflict the build.xml returns to its\nlast committed state of dest repo, so git cannot determine any\nchanges.\nTherefore, i cannot execute git add for this file and i cannot commit\nmy merge results, because git sees it as a partial commit.\n\nAny ideas?\n\nThanks,\nEugene\n"},{"id":"147135","messageId":"20100804205916.GC2920@burratino","threadId":"24636","inReplyTo":"AANLkTi=Hp6DsE75XbgehS2bucp-M9NXmGgYbvw0kp6j8@mail.gmail.com","subject":"Re: git merge - \"both added\" conflict resolution","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-04T20:59:16Z","receivedAt":"2010-08-04T20:59:16Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Eugene,\n\nEugene Sajine wrote:\n\n[in an add/add conflict]\n>           when i resolve the conflict the build.xml returns to its\n> last committed state of dest repo, so git cannot determine any\n> changes.\n> Therefore, i cannot execute git add for this file and i cannot commit\n> my merge results\n\nCould you explain further (preferrably with a simple example\ntranscript)?  I would think that after an add/add conflict,\na simple \"git add\" would mark the file resolved and allow\ncommitting.\n"},{"id":"147141","messageId":"AANLkTi=dScNMsf4XZ+sS8R+424fESyOr6wYO4WamAutj@mail.gmail.com","threadId":"24636","inReplyTo":"20100804205916.GC2920@burratino","subject":"Re: git merge - \"both added\" conflict resolution","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-08-04T23:29:21Z","receivedAt":"2010-08-04T23:29:21Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Wed, Aug 4, 2010 at 4:59 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi Eugene,\n>\n> Eugene Sajine wrote:\n>\n> [in an add/add conflict]\n>>           when i resolve the conflict the build.xml returns to its\n>> last committed state of dest repo, so git cannot determine any\n>> changes.\n>> Therefore, i cannot execute git add for this file and i cannot commit\n>> my merge results\n>\n> Could you explain further (preferrably with a simple example\n> transcript)?  I would think that after an add/add conflict,\n> a simple \"git add\" would mark the file resolved and allow\n> committing.\n>\n\nLet's say in a source repository i have a master branch with few\ncoomits and only two files file1.java and build.xml\nbuild.xml is as simple as few lines one of which is\n...\n<property name=projectName value=projectOne/>\n...\nIn the second *unrelated* repository which is the destination for\nmerge I have a master branch with two files: file2.java and build.xml\nthis build.xml is absolutely identical with an exception of the\nprojectName property\n...\n<property name=projectName value=projectTwo/>\n...\n\nI'm doing\n$ cd projecttwo (I'm in master branch)\n$ git add remote temp ../projectone\n$ git fetch temp\n$ git merge temp/master\n\nhere i'm getting a conflict in build.xml.\nfile1.java is succesfully staged for commit\n\nFor build.xml git status gives me\n...\nboth added: build.xml\n...\n\nNow i have to resolve the conflict on build.xml and as I'm merging two\nprojects into one it is obvious that the resolution of the conflict is\nto leave the original version of build.xml\n\nSo, I'm removing all conflict markers and removing the incoming line\nwith the property value=projectOne leaving it as projectTwo.\nThis effectively means that there is no changes in build.xml for git.\nAnd I'm stuck because i cannot add file, that is not changed and\ncannot commit merge results as it is a partial commit.\n\nIs that better;)?\n\nInteresting enough this worked OK on git version 1.6.4.msysgit.0\nBut giving me headache in git 1.7.0.5 on Linux\n\nBelow is command sequence which is supposed to reflect everything above\n\nmkdir test3\nmkdir test4\ncd test3/\ngit init\necho file content> file1.java\ngit add .\ngit commit -am \"initial commit\"\necho \"<property name=projectname value=test3/>\" > build.xml\ngit add .\ngit commit -am \"add build.xml\"\necho \"more content\" >> file1.java\ngit commit -am \"some change\"\ncd ../test4\ngit init\necho file content> file2.java\ngit add .\ngit commit -am \"initial commit\"\necho \"<property name=projectname value=test4/>\" > build.xml\ngit add .\ngit commit -am \"add build.xml\"\necho \"more content\" >> file2.java\ngit commit -am \"another change\"\ngit remote add temp ../test3\ngit fetch temp\ngit merge temp/master\ngit status\nvi build.xml\ngit status\ngit add build.xml\ngit st\ngit commit -am \"merging\"\n\n\nThanks,\nEugene\n"},{"id":"147143","messageId":"20100804233652.GB3595@burratino","threadId":"24636","inReplyTo":"AANLkTi=dScNMsf4XZ+sS8R+424fESyOr6wYO4WamAutj@mail.gmail.com","subject":"Re: git merge - \"both added\" conflict resolution","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-04T23:36:52Z","receivedAt":"2010-08-04T23:36:52Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eugene Sajine wrote:\n\n> So, I'm removing all conflict markers and removing the incoming line\n> with the property value=projectOne leaving it as projectTwo.\n> This effectively means that there is no changes in build.xml for git.\n> And I'm stuck because i cannot add file, that is not changed\n\nSorry I wasn’t clear before.  Could you give output from attempting\nto add the file?  It is supposed to work.\n"},{"id":"147192","messageId":"AANLkTimJmHwzDQL00=Mbo2ENR1beRB=P0WKU4S7fRctQ@mail.gmail.com","threadId":"24636","inReplyTo":"20100804233652.GB3595@burratino","subject":"Re: git merge - \"both added\" conflict resolution","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-08-05T14:41:03Z","receivedAt":"2010-08-05T14:41:03Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Wed, Aug 4, 2010 at 7:36 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Eugene Sajine wrote:\n>\n>> So, I'm removing all conflict markers and removing the incoming line\n>> with the property value=projectOne leaving it as projectTwo.\n>> This effectively means that there is no changes in build.xml for git.\n>> And I'm stuck because i cannot add file, that is not changed\n>\n> Sorry I wasn’t clear before.  Could you give output from attempting\n> to add the file?  It is supposed to work.\n>\n\n\nThere is no output after I add build.xml with resolved conflicts. When\ni do git status build.xml doesn't show up there.\n\nI tried another way:\nAfter i have a conflict i add the build.xml withtout resolving\nconflicts. Then I unstage it - it's status changes from \"both added: \"\nto \"modified\"\nThen i can resolve the conflict, which means build.xml returns to it's\nlast committed state. But then i'm back to square one as build.xml is\nnot showing in changes, so i cannot add it and i still cannot commit\nbecause of partial commit.\n\nThanks,\nEugene\n"},{"id":"147318","messageId":"AANLkTik0NmRg1Du+QM_SexZvijRUD5X6zyuCgwq0+GUR@mail.gmail.com","threadId":"24636","inReplyTo":"AANLkTimJmHwzDQL00=Mbo2ENR1beRB=P0WKU4S7fRctQ@mail.gmail.com","subject":"Re: git merge - \"both added\" conflict resolution","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-08-06T14:57:07Z","receivedAt":"2010-08-06T14:57:07Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Thu, Aug 5, 2010 at 10:41 AM, Eugene Sajine <euguess@gmail.com> wrote:\n> On Wed, Aug 4, 2010 at 7:36 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Eugene Sajine wrote:\n>>\n>>> So, I'm removing all conflict markers and removing the incoming line\n>>> with the property value=projectOne leaving it as projectTwo.\n>>> This effectively means that there is no changes in build.xml for git.\n>>> And I'm stuck because i cannot add file, that is not changed\n>>\n>> Sorry I wasn’t clear before.  Could you give output from attempting\n>> to add the file?  It is supposed to work.\n>>\n>\n>\n> There is no output after I add build.xml with resolved conflicts. When\n> i do git status build.xml doesn't show up there.\n>\n> I tried another way:\n> After i have a conflict i add the build.xml withtout resolving\n> conflicts. Then I unstage it - it's status changes from \"both added: \"\n> to \"modified\"\n> Then i can resolve the conflict, which means build.xml returns to it's\n> last committed state. But then i'm back to square one as build.xml is\n> not showing in changes, so i cannot add it and i still cannot commit\n> because of partial commit.\n>\n> Thanks,\n> Eugene\n>\n\nWhen i experimenting with it with test repos - it is working OK.\nSo, i believe it will be very difficult to reproduce.\n\nI'm still having this problem with two repos of mine, but as it is not\ncommon, i gotta dig deeper there.\n\nThanks,\nEugene\n"}]}