{"thread":{"id":"19173","subject":"Wrong conflicts on file splits","startedAt":"2009-05-04T12:53:11Z","lastAt":"2009-05-04T15:30:47Z","messageCount":7,"participants":["Jon Smirl","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"112973","messageId":"9e4733910905040553u377ab11n1609d980021be498@mail.gmail.com","threadId":"19173","inReplyTo":null,"subject":"Wrong conflicts on file splits","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2009-05-04T12:53:11Z","receivedAt":"2009-05-04T12:53:11Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"I keep running into this problem, is there anything I can do to make\nit better? I'm using stgit but this is a problem in git itself.\n\nI have a patch that splits file A into two files, A and B.\nNow I merge with another tree and bring in a one line fix to A.\nThe fix touches the pre-split file A in a section that is going to end up in B.\nNext I re-apply the patch that splits A into A and B.\n\nThis results in a large conflict in the post split file A.\nAnd no patch being applied to file B which is where the fix belongs.\n\nRepeat this process with a multi-line fix and the whole automated\nmerge process breaks down and I have to carefully figure everything\nout by hand.\n\nThe merge process seems to be unaware of the newly created file B. No\npatches or conflict ever end up in it.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"112976","messageId":"49FEED2C.8010501@drmicha.warpmail.net","threadId":"19173","inReplyTo":"9e4733910905040553u377ab11n1609d980021be498@mail.gmail.com","subject":"Re: Wrong conflicts on file splits","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-05-04T13:27:08Z","receivedAt":"2009-05-04T13:27:08Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n> I keep running into this problem, is there anything I can do to make\n> it better? I'm using stgit but this is a problem in git itself.\n> \n> I have a patch that splits file A into two files, A and B.\n> Now I merge with another tree and bring in a one line fix to A.\n> The fix touches the pre-split file A in a section that is going to end up in B.\n> Next I re-apply the patch that splits A into A and B.\n> \n> This results in a large conflict in the post split file A.\n> And no patch being applied to file B which is where the fix belongs.\n> \n> Repeat this process with a multi-line fix and the whole automated\n> merge process breaks down and I have to carefully figure everything\n> out by hand.\n> \n> The merge process seems to be unaware of the newly created file B. No\n> patches or conflict ever end up in it.\n> \n\nCan you provide a test case or at least a list of commands which you are\nissuing? You complain about \"merge\", but you say you are \"applying a\npatch\". Are you merging that patch from another branch, or are you\nreally applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n\nCheers,\nMichael\n"},{"id":"112977","messageId":"9e4733910905040642h5932e80ds5c467db90e03f40d@mail.gmail.com","threadId":"19173","inReplyTo":"49FEED2C.8010501@drmicha.warpmail.net","subject":"Re: Wrong conflicts on file splits","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2009-05-04T13:42:25Z","receivedAt":"2009-05-04T13:42:25Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On Mon, May 4, 2009 at 9:27 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n>> I keep running into this problem, is there anything I can do to make\n>> it better? I'm using stgit but this is a problem in git itself.\n>>\n>> I have a patch that splits file A into two files, A and B.\n>> Now I merge with another tree and bring in a one line fix to A.\n>> The fix touches the pre-split file A in a section that is going to end up in B.\n>> Next I re-apply the patch that splits A into A and B.\n>>\n>> This results in a large conflict in the post split file A.\n>> And no patch being applied to file B which is where the fix belongs.\n>>\n>> Repeat this process with a multi-line fix and the whole automated\n>> merge process breaks down and I have to carefully figure everything\n>> out by hand.\n>>\n>> The merge process seems to be unaware of the newly created file B. No\n>> patches or conflict ever end up in it.\n>>\n>\n> Can you provide a test case or at least a list of commands which you are\n> issuing? You complain about \"merge\", but you say you are \"applying a\n> patch\". Are you merging that patch from another branch, or are you\n> really applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n\nWhat git command does stgit use internally on push/pop?\n\nIt's the stg push of a patch creating a split on top of a change to\nthe section that is going to end up in file B that causes the problem.\n\n\n\n>\n> Cheers,\n> Michael\n>\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"112979","messageId":"49FEF25A.3090305@drmicha.warpmail.net","threadId":"19173","inReplyTo":"9e4733910905040642h5932e80ds5c467db90e03f40d@mail.gmail.com","subject":"Re: Wrong conflicts on file splits","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-05-04T13:49:14Z","receivedAt":"2009-05-04T13:49:14Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jon Smirl venit, vidit, dixit 04.05.2009 15:42:\n> On Mon, May 4, 2009 at 9:27 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n>>> I keep running into this problem, is there anything I can do to make\n>>> it better? I'm using stgit but this is a problem in git itself.\n>>>\n>>> I have a patch that splits file A into two files, A and B.\n>>> Now I merge with another tree and bring in a one line fix to A.\n>>> The fix touches the pre-split file A in a section that is going to end up in B.\n>>> Next I re-apply the patch that splits A into A and B.\n>>>\n>>> This results in a large conflict in the post split file A.\n>>> And no patch being applied to file B which is where the fix belongs.\n>>>\n>>> Repeat this process with a multi-line fix and the whole automated\n>>> merge process breaks down and I have to carefully figure everything\n>>> out by hand.\n>>>\n>>> The merge process seems to be unaware of the newly created file B. No\n>>> patches or conflict ever end up in it.\n>>>\n>>\n>> Can you provide a test case or at least a list of commands which you are\n>> issuing? You complain about \"merge\", but you say you are \"applying a\n>> patch\". Are you merging that patch from another branch, or are you\n>> really applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n> \n> What git command does stgit use internally on push/pop?\n> \n> It's the stg push of a patch creating a split on top of a change to\n> the section that is going to end up in file B that causes the problem.\n\nI see. So it's really rebasing/applying here rather then merging. I\ndon't think they have the necessary info in order to do content-based\npatching across file boundaries.\n\nMichael\n"},{"id":"112981","messageId":"9e4733910905040652s60f0a229qef18b36d386905ee@mail.gmail.com","threadId":"19173","inReplyTo":"49FEF25A.3090305@drmicha.warpmail.net","subject":"Re: Wrong conflicts on file splits","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2009-05-04T13:52:47Z","receivedAt":"2009-05-04T13:52:47Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On Mon, May 4, 2009 at 9:49 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Jon Smirl venit, vidit, dixit 04.05.2009 15:42:\n>> On Mon, May 4, 2009 at 9:27 AM, Michael J Gruber\n>> <git@drmicha.warpmail.net> wrote:\n>>> Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n>>>> I keep running into this problem, is there anything I can do to make\n>>>> it better? I'm using stgit but this is a problem in git itself.\n>>>>\n>>>> I have a patch that splits file A into two files, A and B.\n>>>> Now I merge with another tree and bring in a one line fix to A.\n>>>> The fix touches the pre-split file A in a section that is going to end up in B.\n>>>> Next I re-apply the patch that splits A into A and B.\n>>>>\n>>>> This results in a large conflict in the post split file A.\n>>>> And no patch being applied to file B which is where the fix belongs.\n>>>>\n>>>> Repeat this process with a multi-line fix and the whole automated\n>>>> merge process breaks down and I have to carefully figure everything\n>>>> out by hand.\n>>>>\n>>>> The merge process seems to be unaware of the newly created file B. No\n>>>> patches or conflict ever end up in it.\n>>>>\n>>>\n>>> Can you provide a test case or at least a list of commands which you are\n>>> issuing? You complain about \"merge\", but you say you are \"applying a\n>>> patch\". Are you merging that patch from another branch, or are you\n>>> really applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n>>\n>> What git command does stgit use internally on push/pop?\n>>\n>> It's the stg push of a patch creating a split on top of a change to\n>> the section that is going to end up in file B that causes the problem.\n>\n> I see. So it's really rebasing/applying here rather then merging. I\n> don't think they have the necessary info in order to do content-based\n> patching across file boundaries.\n\nAre there git commands that can do this properly? stgit is just a\nbunch of Python executing git commands, they can change which commands\nare getting called.\n\n>\n> Michael\n>\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"112988","messageId":"49FF01AA.9010301@drmicha.warpmail.net","threadId":"19173","inReplyTo":"9e4733910905040652s60f0a229qef18b36d386905ee@mail.gmail.com","subject":"Re: Wrong conflicts on file splits","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-05-04T14:54:34Z","receivedAt":"2009-05-04T14:54:34Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jon Smirl venit, vidit, dixit 04.05.2009 15:52:\n> On Mon, May 4, 2009 at 9:49 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Jon Smirl venit, vidit, dixit 04.05.2009 15:42:\n>>> On Mon, May 4, 2009 at 9:27 AM, Michael J Gruber\n>>> <git@drmicha.warpmail.net> wrote:\n>>>> Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n>>>>> I keep running into this problem, is there anything I can do to make\n>>>>> it better? I'm using stgit but this is a problem in git itself.\n>>>>>\n>>>>> I have a patch that splits file A into two files, A and B.\n>>>>> Now I merge with another tree and bring in a one line fix to A.\n>>>>> The fix touches the pre-split file A in a section that is going to end up in B.\n>>>>> Next I re-apply the patch that splits A into A and B.\n>>>>>\n>>>>> This results in a large conflict in the post split file A.\n>>>>> And no patch being applied to file B which is where the fix belongs.\n>>>>>\n>>>>> Repeat this process with a multi-line fix and the whole automated\n>>>>> merge process breaks down and I have to carefully figure everything\n>>>>> out by hand.\n>>>>>\n>>>>> The merge process seems to be unaware of the newly created file B. No\n>>>>> patches or conflict ever end up in it.\n>>>>>\n>>>>\n>>>> Can you provide a test case or at least a list of commands which you are\n>>>> issuing? You complain about \"merge\", but you say you are \"applying a\n>>>> patch\". Are you merging that patch from another branch, or are you\n>>>> really applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n>>>\n>>> What git command does stgit use internally on push/pop?\n>>>\n>>> It's the stg push of a patch creating a split on top of a change to\n>>> the section that is going to end up in file B that causes the problem.\n>>\n>> I see. So it's really rebasing/applying here rather then merging. I\n>> don't think they have the necessary info in order to do content-based\n>> patching across file boundaries.\n> \n> Are there git commands that can do this properly? stgit is just a\n> bunch of Python executing git commands, they can change which commands\n> are getting called.\n\nOK, I checked the source, and in fact stgit uses git's merge strategies.\n\nI also checked a simple example (splitting `seq 1 20`) in two. It seems\nthat git's rename detection does not detect that to be a rename/copy\n(split). As a consequence, the merge strategy performs only a file based\nmerge between the versions of A. One would need to teach git about \"a\nbetter split detection\" in order to cope with such a situation.\n\nOn the other hand, if you know the split, can't you redo that manually?\nI mean, checkout the new version (with the multi-line fixes), split it,\ngit-add and git-commit to resolve.\n\nMichael\n"},{"id":"112991","messageId":"9e4733910905040830w1800d461udde3fa5b314e278f@mail.gmail.com","threadId":"19173","inReplyTo":"49FF01AA.9010301@drmicha.warpmail.net","subject":"Re: Wrong conflicts on file splits","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2009-05-04T15:30:47Z","receivedAt":"2009-05-04T15:30:47Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On Mon, May 4, 2009 at 10:54 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Jon Smirl venit, vidit, dixit 04.05.2009 15:52:\n>> On Mon, May 4, 2009 at 9:49 AM, Michael J Gruber\n>> <git@drmicha.warpmail.net> wrote:\n>>> Jon Smirl venit, vidit, dixit 04.05.2009 15:42:\n>>>> On Mon, May 4, 2009 at 9:27 AM, Michael J Gruber\n>>>> <git@drmicha.warpmail.net> wrote:\n>>>>> Jon Smirl venit, vidit, dixit 04.05.2009 14:53:\n>>>>>> I keep running into this problem, is there anything I can do to make\n>>>>>> it better? I'm using stgit but this is a problem in git itself.\n>>>>>>\n>>>>>> I have a patch that splits file A into two files, A and B.\n>>>>>> Now I merge with another tree and bring in a one line fix to A.\n>>>>>> The fix touches the pre-split file A in a section that is going to end up in B.\n>>>>>> Next I re-apply the patch that splits A into A and B.\n>>>>>>\n>>>>>> This results in a large conflict in the post split file A.\n>>>>>> And no patch being applied to file B which is where the fix belongs.\n>>>>>>\n>>>>>> Repeat this process with a multi-line fix and the whole automated\n>>>>>> merge process breaks down and I have to carefully figure everything\n>>>>>> out by hand.\n>>>>>>\n>>>>>> The merge process seems to be unaware of the newly created file B. No\n>>>>>> patches or conflict ever end up in it.\n>>>>>>\n>>>>>\n>>>>> Can you provide a test case or at least a list of commands which you are\n>>>>> issuing? You complain about \"merge\", but you say you are \"applying a\n>>>>> patch\". Are you merging that patch from another branch, or are you\n>>>>> really applying it as a patch (git-apply/cherry-pick/rebase/what-not)?\n>>>>\n>>>> What git command does stgit use internally on push/pop?\n>>>>\n>>>> It's the stg push of a patch creating a split on top of a change to\n>>>> the section that is going to end up in file B that causes the problem.\n>>>\n>>> I see. So it's really rebasing/applying here rather then merging. I\n>>> don't think they have the necessary info in order to do content-based\n>>> patching across file boundaries.\n>>\n>> Are there git commands that can do this properly? stgit is just a\n>> bunch of Python executing git commands, they can change which commands\n>> are getting called.\n>\n> OK, I checked the source, and in fact stgit uses git's merge strategies.\n>\n> I also checked a simple example (splitting `seq 1 20`) in two. It seems\n> that git's rename detection does not detect that to be a rename/copy\n> (split). As a consequence, the merge strategy performs only a file based\n> merge between the versions of A. One would need to teach git about \"a\n> better split detection\" in order to cope with such a situation.\n>\n> On the other hand, if you know the split, can't you redo that manually?\n> I mean, checkout the new version (with the multi-line fixes), split it,\n> git-add and git-commit to resolve.\n\nI have 14 more patches layered on top of the split. Redoing the split\nmanually causes a cascade of conflicts. You get into this situation\nwhen working on a large series that takes time to debug and get right.\n My current solution is to undo the fixes to the split files, apply\nthe split, and then manually make new patches to redo the fix. That\navoids the cascade problem triggered by changing the patch that\ncreates the split.\n\nDoes it really need to do rename detection? The fact that a new file\nis created is recorded in the diff, there's no need to go searching\nfor it.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"}]}