{"thread":{"id":"5113","subject":"[PATCH] Introducing cg-xxdiff for conflict resolution","startedAt":"2006-08-04T03:34:07Z","lastAt":"2006-11-03T02:41:47Z","messageCount":9,"participants":["Martin Langhoff","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24679","messageId":"11546624471356-git-send-email-martin@catalyst.net.nz","threadId":"5113","inReplyTo":null,"subject":"[PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2006-08-04T03:34:07Z","receivedAt":"2006-08-04T03:34:07Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"This is a bit of a crude but really useful shortcut for conflict resolution.\nThe name is bad, but matches git-xxdiff which has been around for like... ages\n\nAs Cogito doesn't make use of the index during merges/applies, cg-xxdiff\nis somewhat more brittle and cannot not help during conflict resolution when\nusing cg-patch.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n---\n Makefile  |    3 ++-\n cg-xxdiff |   33 +++++++++++++++++++++++++++++++++\n 2 files changed, 35 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ba9bf9a..dc21702 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -18,7 +18,8 @@ SCRIPT=\tcg-object-id cg-add cg-admin-lso\n \tcg-export cg-help cg-init cg-log cg-merge cg-mkpatch cg-patch \\\n \tcg-fetch cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update \\\n \tcg cg-admin-ls cg-push cg-branch-chg cg-admin-cat cg-clean \\\n-\tcg-admin-setuprepo cg-switch cg-mv cg-admin-rewritehist cg-tag-show\n+\tcg-admin-setuprepo cg-switch cg-mv cg-admin-rewritehist cg-tag-show \\\n+\tcg-xxdiff\n \n LIB_SCRIPT=cg-Xlib cg-Xmergefile cg-Xfetchprogress cg-Xfollowrenames\n \ndiff --git a/cg-xxdiff b/cg-xxdiff\nnew file mode 100755\nindex 0000000..7a1a863\n--- /dev/null\n+++ b/cg-xxdiff\n@@ -0,0 +1,33 @@\n+#!/bin/sh\n+\n+USAGE='<path-with-conflict>'\n+SUBDIRECTORY_OK=No\n+. git-sh-setup\n+\n+FILE=$1\n+\n+# Sanity checks\n+if test ! -n \"$FILE\"\n+then\n+\techo Need a path\n+\texit 1\n+fi\n+\n+git cat-file blob `git rev-parse HEAD`:$FILE > $FILE~ours\n+if test $? -gt 0\n+then \n+\techo \"Error - $FILE is not tracked by git or does not have a conflict\"\n+\texit 1\n+fi\n+echo Written $FILE~ours\n+\n+git cat-file blob `git rev-parse FETCH_HEAD`:$FILE > $FILE~branch\n+if  test $? -gt 0\n+then \n+\techo \"Error - $FILE is not tracked by git or does not have a conflict\"\n+\texit 1\n+fi\n+echo Written $FILE~branch\n+echo Resolved file will be saved as $FILE~merged\n+\n+xxdiff -wbB --show-merged-pane --merged-filename $FILE~merged $FILE~ours $FILE~branch\n-- \n1.4.2.rc2.ge1f7\n"},{"id":"27558","messageId":"20060924165037.GS20017@pasky.or.cz","threadId":"5113","inReplyTo":"11546624471356-git-send-email-martin@catalyst.net.nz","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-09-24T16:50:37Z","receivedAt":"2006-09-24T16:50:37Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Aug 04, 2006 at 05:34:07AM CEST, I got a letter\nwhere Martin Langhoff <martin@catalyst.net.nz> said that...\n> This is a bit of a crude but really useful shortcut for conflict resolution.\n> The name is bad, but matches git-xxdiff which has been around for like... ages\n\nYes, the name is horrible. :-)\n\n> As Cogito doesn't make use of the index during merges/applies, cg-xxdiff\n> is somewhat more brittle and cannot not help during conflict resolution when\n> using cg-patch.\n> \n> Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>\n\nHmm, I think this would be generally more useful during the actual merge\nphase - if merge returns error, you fire up\ngit-magic-conflict-resolution-driver and have fun.\n\nWhich reminds me that I should make some more effort to unify\ncg-Xmergeonefile and git-merge-one-file...\n\n> +. git-sh-setup\n\nUh-oh. :-)\n\n> +git cat-file blob `git rev-parse FETCH_HEAD`:$FILE > $FILE~branch\n\nCogito does not use FETCH_HEAD.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"},{"id":"27561","messageId":"46a038f90609241002i1db98ed6n118077089c9e417f@mail.gmail.com","threadId":"5113","inReplyTo":"20060924165037.GS20017@pasky.or.cz","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-09-24T17:02:28Z","receivedAt":"2006-09-24T17:02:28Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/24/06, Petr Baudis <pasky@suse.cz> wrote:\n> Hmm, I think this would be generally more useful during the actual merge\n> phase - if merge returns error, you fire up\n> git-magic-conflict-resolution-driver and have fun.\n\nWell, in many cases the conflict markers are just ok and exactly what\nI want. If the two sides of the conflict are clear, the resolution is\nusually clear as well. OTOH, it may be a big mess where xxdiff gives\nmore visual cues as to WTF is going on...\n\nIOW I don't want it to be part of the merge automagically...\n\n> > +. git-sh-setup\n>\n> Uh-oh. :-)\n\nIs that bad? <blush> I am not doing anything too cogito-specific, and\nI just don't know what cg-Xlib will do for me...\n\n> > +git cat-file blob `git rev-parse FETCH_HEAD`:$FILE > $FILE~branch\n>\n> Cogito does not use FETCH_HEAD.\n\neeek. you ar right. I mix and match git and cogito as you can see. Not\nso smart. I see cg-merge uses merging, merge-base and merging-sym --\nI'll rework it using those...\n\ncheers,\n\n\n\nmartin\n"},{"id":"27562","messageId":"20060924171246.GY13132@pasky.or.cz","threadId":"5113","inReplyTo":"46a038f90609241002i1db98ed6n118077089c9e417f@mail.gmail.com","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-09-24T17:12:46Z","receivedAt":"2006-09-24T17:12:46Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Sep 24, 2006 at 07:02:28PM CEST, I got a letter\nwhere Martin Langhoff <martin.langhoff@gmail.com> said that...\n> On 9/24/06, Petr Baudis <pasky@suse.cz> wrote:\n> >Hmm, I think this would be generally more useful during the actual merge\n> >phase - if merge returns error, you fire up\n> >git-magic-conflict-resolution-driver and have fun.\n> \n> Well, in many cases the conflict markers are just ok and exactly what\n> I want. If the two sides of the conflict are clear, the resolution is\n> usually clear as well. OTOH, it may be a big mess where xxdiff gives\n> more visual cues as to WTF is going on...\n> \n> IOW I don't want it to be part of the merge automagically...\n\nIn that case I think the most natural way for this tool to interface\nwould be in part of some kind of cg-resolve swiss-army knife for\nresolving conflicts:\n\n\tcg-resolve --mine\tfor taking just the version from _my_\n\t\t\t\tside of the merge\n\tcg-resolve --other\tdtto for the other side of the merge\n\tcg-resolve -g\t\tgraphically resolve\n\t\t\t\t(vimdiff/xxdiff/meld/...)\n\tsurely more would be invented over time\n\n> >> +. git-sh-setup\n> >\n> >Uh-oh. :-)\n> \n> Is that bad? <blush> I am not doing anything too cogito-specific, and\n> I just don't know what cg-Xlib will do for me...\n\nWell, all the Cogito scripts should have some consistent form. :-)\n\nBut I can adjust such details when applying your patch.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"},{"id":"27563","messageId":"46a038f90609241022i6ac11da1o1a1cba199595d036@mail.gmail.com","threadId":"5113","inReplyTo":"20060924171246.GY13132@pasky.or.cz","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-09-24T17:22:35Z","receivedAt":"2006-09-24T17:22:35Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/24/06, Petr Baudis <pasky@suse.cz> wrote:\n> In that case I think the most natural way for this tool to interface\n> would be in part of some kind of cg-resolve swiss-army knife for\n> resolving conflicts:\n>\n>        cg-resolve --mine       for taking just the version from _my_\n>                                side of the merge\n>        cg-resolve --other      dtto for the other side of the merge\n>        cg-resolve -g           graphically resolve\n>                                (vimdiff/xxdiff/meld/...)\n>        surely more would be invented over time\n\nSounds reasonable. But I think we have to keep in mind that you only\nknow if the conflict is nasty after you have a go at fixing it. And I\nsometimes find that I try with cg-xxdiff... and I go back to the plain\nold conflict. That is why it doesn't clobber the file -- to protect a\nmanual merge in process.\n\n> Well, all the Cogito scripts should have some consistent form. :-)\n\nheh - consistency? overrated! ;-)\n\n> But I can adjust such details when applying your patch.\n\nGreat! -- I'm travelling and at an airport \"free access\" computer. It\nshould be illegal to run airports without free wifi in this day and\nage.\n\ncheers,\n\n\nmartin\n"},{"id":"27564","messageId":"20060924172838.GZ13132@pasky.or.cz","threadId":"5113","inReplyTo":"46a038f90609241022i6ac11da1o1a1cba199595d036@mail.gmail.com","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-09-24T17:28:38Z","receivedAt":"2006-09-24T17:28:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Sep 24, 2006 at 07:22:35PM CEST, I got a letter\nwhere Martin Langhoff <martin.langhoff@gmail.com> said that...\n> On 9/24/06, Petr Baudis <pasky@suse.cz> wrote:\n> >In that case I think the most natural way for this tool to interface\n> >would be in part of some kind of cg-resolve swiss-army knife for\n> >resolving conflicts:\n> >\n> >       cg-resolve --mine       for taking just the version from _my_\n> >                               side of the merge\n> >       cg-resolve --other      dtto for the other side of the merge\n> >       cg-resolve -g           graphically resolve\n> >                               (vimdiff/xxdiff/meld/...)\n> >       surely more would be invented over time\n> \n> Sounds reasonable. But I think we have to keep in mind that you only\n> know if the conflict is nasty after you have a go at fixing it. And I\n> sometimes find that I try with cg-xxdiff... and I go back to the plain\n> old conflict. That is why it doesn't clobber the file -- to protect a\n> manual merge in process.\n\nOh yes, I wanted to complain about that. ;-)\n\nYes, sometimes it is useful to go back, but I guess most of the time\nprobably not (not speaking from the experience though) and I hate tools\nwhich leave random copies of a file I have tracked in a VCS around and I\nhave to collect their garbage manually.\n\nThe tool should just have a way to tell it \"cancel\" in case of trouble\nand restore the original state of the file. And of course\n\n\tcg-resolve --remerge\tre-run the 3-way merge on the file\n\nwould be useful anyway.\n\n> >But I can adjust such details when applying your patch.\n> \n> Great! -- I'm travelling and at an airport \"free access\" computer. It\n> should be illegal to run airports without free wifi in this day and\n> age.\n\nHeartily agreed.\n\nWe should always suggest the locals to build yet another airport right\nnear the old one to promote free market and competition!\n\nAnd when one of them bankrupts it could make for a nice paintball arena,\nI guess.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"},{"id":"293999","messageId":"46a038f90611021540s14b6098p477a68ef00c826e9@mail.gmail.com","threadId":"5113","inReplyTo":"20060924172838.GZ13132@pasky.or.cz","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-11-02T23:40:38Z","receivedAt":"2006-11-02T23:40:38Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/25/06, Petr Baudis <pasky@suse.cz> wrote:\n> > >But I can adjust such details when applying your patch.\n> >\n> > Great! -- I'm travelling and at an airport \"free access\" computer. It\n> > should be illegal to run airports without free wifi in this day and\n> > age.\n>\n> Heartily agreed.\n\nPaski, did this one get dropped? Change of heart? Heart attack?\n\ncheers,\n\n\n"},{"id":"298607","messageId":"20061103001135.GN20017@pasky.or.cz","threadId":"5113","inReplyTo":"46a038f90611021540s14b6098p477a68ef00c826e9@mail.gmail.com","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-11-03T00:11:35Z","receivedAt":"2006-11-03T00:11:35Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Nov 03, 2006 at 12:40:38AM CET, I got a letter\nwhere Martin Langhoff <martin.langhoff@gmail.com> said that...\n> On 9/25/06, Petr Baudis <pasky@suse.cz> wrote:\n> >> >But I can adjust such details when applying your patch.\n> >>\n> >> Great! -- I'm travelling and at an airport \"free access\" computer. It\n> >> should be illegal to run airports without free wifi in this day and\n> >> age.\n> >\n> >Heartily agreed.\n> \n> Paski, did this one get dropped? Change of heart? Heart attack?\n\nHmm, I thought we've agreed to go for the cg-resolve solution\ninstead...?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\n"},{"id":"295473","messageId":"46a038f90611021841p54c38d72x12360ec93f32a8ad@mail.gmail.com","threadId":"5113","inReplyTo":"20061103001135.GN20017@pasky.or.cz","subject":"Re: [PATCH] Introducing cg-xxdiff for conflict resolution","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-11-03T02:41:47Z","receivedAt":"2006-11-03T02:41:47Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 11/3/06, Petr Baudis <pasky@suse.cz> wrote:\n> > Paski, did this one get dropped? Change of heart? Heart attack?\n>\n> Hmm, I thought we've agreed to go for the cg-resolve solution\n> instead...?\n\nOops. That wasn't my reading. Misunderstood. In any case, if you go\nback a bit in the conversation, the usage model I find this useful is\none where it makes sense to try different tools that have entirely\ndifferent parameters. That is why it makes sense to call them\ndifferently.\n\nSo cg-meld [meld params] , is different from cg-xxdiff [xxdiff params]\nand cg-wiggle [wiggle params] makes more sense to me and can be\nmaintained by different people (those who like meld probably dont' use\nxxdiff ;-)\n\nAnd from a packaging perspective, cg-resolve will depend on a zillion things.\n\ncheers,\n\n\n"}]}