{"thread":{"id":"47046","subject":"How to re-merge paths differently?","startedAt":"2017-10-27T15:54:02Z","lastAt":"2017-10-30T05:02:36Z","messageCount":4,"participants":["Sergey Organov","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"331171","messageId":"87wp3g61ez.fsf@javad.com","threadId":"47046","inReplyTo":null,"subject":"How to re-merge paths differently?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2017-10-27T15:44:20Z","receivedAt":"2017-10-27T15:54:02Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Hello,\n\nIs there anything like this:\n\n$ git merge b\n[... lot of conflicts ...]\n$ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/\n$ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/\n[... resolve the rest of conflicts manually ...]\n$ git commit\n\n[*] I do mean '-X' above, not '-s'.\n\n-- Sergey\n"},{"id":"331235","messageId":"3655514352684AD398D17E83FF47F986@PhilipOakley","threadId":"47046","inReplyTo":"87wp3g61ez.fsf@javad.com","subject":"Re: How to re-merge paths differently?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2017-10-28T17:37:14Z","receivedAt":"2017-10-28T17:37:22Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Sergey Organov\" <sorganov@gmail.com>\n> Is there anything like this:\n>\n> $ git merge b\n> [... lot of conflicts ...]\n> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/\n> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/\n> [... resolve the rest of conflicts manually ...]\n> $ git commit\n>\n> [*] I do mean '-X' above, not '-s'.\n>\n\nBy this I presume you mean that you have paths x and y that ate the ones \nwith conflicts within them following the `git merge b`.\n\nYou then want a variant of the `git merge` command that will apply the `-X \nours` policy *specifically to path x* so that its particular set of \nconflicts is fully resolved in favour of 'ours'.\n\nYou then want to repeat those path specific resolutions, on a path by path \nbasis, to either `-X ours` or `-X theirs` until they are done.\n\nYou are also expecting that one or two conflicts will require to be fully \nmanually resolved, until finally you can commit the result.\n\nWould that be right?\n\nAlso, how do you intend to identify the 'x' and the 'y' paths, so that you \ncan chose the ours/theirs/manual selection? (e.g. do you pre-know a \nregex/blob expansion)\n\nThe answer for individual paths is probably in the mergetool of your choice.\n--\nPhilip \n\n"},{"id":"331236","messageId":"CDBB804CFC3842CF862FE12D99D60D79@PhilipOakley","threadId":"47046","inReplyTo":"3655514352684AD398D17E83FF47F986@PhilipOakley","subject":"Re: How to re-merge paths differently?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2017-10-28T17:50:19Z","receivedAt":"2017-10-28T17:50:26Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Philip Oakley\" <philipoakley@iee.org>\n> From: \"Sergey Organov\" <sorganov@gmail.com>\n>> Is there anything like this:\n>>\n>> $ git merge b\n>> [... lot of conflicts ...]\n>> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/\n>> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/\n>> [... resolve the rest of conflicts manually ...]\n>> $ git commit\n>>\n>> [*] I do mean '-X' above, not '-s'.\n>>\n> \n> By this I presume you mean that you have paths x and y that ate the ones \n\ns/ate/are/   \n\n> with conflicts within them following the `git merge b`.\n> \n\n[snip]\n"},{"id":"331329","messageId":"8737615iu5.fsf@javad.com","threadId":"47046","inReplyTo":"3655514352684AD398D17E83FF47F986@PhilipOakley","subject":"Re: How to re-merge paths differently?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2017-10-30T05:02:26Z","receivedAt":"2017-10-30T05:02:36Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n> From: \"Sergey Organov\" <sorganov@gmail.com>\n>> Is there anything like this:\n>>\n>> $ git merge b\n>> [... lot of conflicts ...]\n>> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/\n>> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/\n>> [... resolve the rest of conflicts manually ...]\n>> $ git commit\n>>\n>> [*] I do mean '-X' above, not '-s'.\n>>\n>\n> By this I presume you mean that you have paths x and y that ate the\n> ones with conflicts within them following the `git merge b`.\n\nI rather mean huge amount of conflicting paths in 'x' and 'y'\nsubdirectories of my working tree after a merge, plus a few conflicting\npaths elsewhere.\n\n>\n> You then want a variant of the `git merge` command that will apply the\n> `-X  ours` policy *specifically to path x* so that its particular set of\n> conflicts is fully resolved in favour of 'ours'.\n\nAlmost. I mean to apply 'ours' option to the default 'recursive' policy for\nall the files that reside in the directory 'x' of my working tree and\nall its subdirectories (i.e., all the paths 'x/*')\n\n>\n> You then want to repeat those path specific resolutions, on a path by\n> path basis, to either `-X ours` or `-X theirs` until they are done.\n\nNo. I mean to apply '-X ours' to everything under 'x/', and '-X theirs'\nto everything under 'y/'. Avoiding to repeat anything is the intention. \n\n> You are also expecting that one or two conflicts will require to be\n> fully manually resolved, until finally you can commit the result.\n\nNo, I expect no conflicts left in either 'x/' or 'y/' after \"re-merge\",\nas neither 'theirs' or 'ours' should leave anything unresolved, and all\nthe other conflicting paths (left from original merge elsewhere) I mean\nto resolve manually.\n \n>\n> Would that be right?\n>\n> Also, how do you intend to identify the 'x' and the 'y' paths, so that\n> you can chose the ours/theirs/manual selection? (e.g. do you pre-know\n> a regex/blob expansion)\n\nAll the 'x/*' paths need 'ours', and all the 'y/*' paths need 'theirs'.\n\n>\n> The answer for individual paths is probably in the mergetool of your\n> choice.\n\nThere are a lot of files under 'x/' and a lot of them under 'y/'. My\nintention is to automate a lot of manual labor, and I'm not aware of a\nmergetool that provides either '-X ours' or '-X theirs' resolution\nautomatically for all the paths specified.\n\n-- Sergey\n"}]}