{"thread":{"id":"42153","subject":"using git-difftool -d when cherry-picking","startedAt":"2016-04-27T09:12:25Z","lastAt":"2016-04-30T10:50:23Z","messageCount":3,"participants":["Jan Smets","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"284638","messageId":"CAH9ve7x3GSVX1M3yuAY1VmM-WoFX36o-vihFQ3Jw-_SZ4Bh_og@mail.gmail.com","threadId":"42153","inReplyTo":null,"subject":"using git-difftool -d when cherry-picking","fromName":"Jan Smets","fromEmail":"jan@smets.cx","sentAt":"2016-04-27T09:12:25Z","receivedAt":"2016-04-27T09:12:25Z","isPatch":false,"sender":{"key":"jan@smets.cx","avatar":null},"body":"Hi\n\nPlease consider following example\n\n#!/bin/bash\nrm -rf /tmp/gittest\nmkdir /tmp/gittest\ncd /tmp/gittest\n\ngit init\n\necho $RANDOM > testfile\ngit add testfile\ngit commit -m test -a\n\ngit branch X\ngit checkout X\necho $RANDOM > testfile\ngit add testfile\ngit commit -m test -a\n\ngit checkout master\necho $RANDOM > testfile\ngit add testfile\ngit commit -m test -a\n\ngit cherry-pick X\ngit diff --raw\ngit difftool -d\n\n\nThis emulates a merge conflict when using git-cerry-pick.\n\n$ git diff --raw\n:000000 100644 0000000... 0000000... U  testfile\n:100644 100644 a04e026... 0000000... M  testfile\n\nWhen executing git difftool with the -d option :\n\n/usr/lib/git-core/git-difftool line 260: File exists\n\nA possible solution is to build an unique list in @working_tree\n\nThe purpose is to edit/resolve the conflict in the difftool.\n\nThanks!\n\n-- \nSmets Jan\njan@smets.cx\n"},{"id":"285041","messageId":"20160430011930.GA26977@gmail.com","threadId":"42153","inReplyTo":"CAH9ve7x3GSVX1M3yuAY1VmM-WoFX36o-vihFQ3Jw-_SZ4Bh_og@mail.gmail.com","subject":"Re: using git-difftool -d when cherry-picking","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-04-30T01:19:30Z","receivedAt":"2016-04-30T01:19:30Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Apr 27, 2016 at 11:12:25AM +0200, Jan Smets wrote:\n> Hi\n> \n> Please consider following example\n> \n> #!/bin/bash\n> rm -rf /tmp/gittest\n> mkdir /tmp/gittest\n> cd /tmp/gittest\n> \n> git init\n> \n> echo $RANDOM > testfile\n> git add testfile\n> git commit -m test -a\n> \n> git branch X\n> git checkout X\n> echo $RANDOM > testfile\n> git add testfile\n> git commit -m test -a\n> \n> git checkout master\n> echo $RANDOM > testfile\n> git add testfile\n> git commit -m test -a\n> \n> git cherry-pick X\n> git diff --raw\n> git difftool -d\n> \n> \n> This emulates a merge conflict when using git-cerry-pick.\n> \n> $ git diff --raw\n> :000000 100644 0000000... 0000000... U  testfile\n> :100644 100644 a04e026... 0000000... M  testfile\n> \n> When executing git difftool with the -d option :\n> \n> /usr/lib/git-core/git-difftool line 260: File exists\n> \n> A possible solution is to build an unique list in @working_tree\n> \n> The purpose is to edit/resolve the conflict in the difftool.\n\n\nThat could be useful.  git-mergetool is intended to be used when\nmerge conflicts exist, but it sounds like you may have already\nfound a possible solution by making @working_tree unique.  Have\nyou tested that to see if it skirts around the issue?\n\nIf you have a patch I'd be happy to help review and test it.\n-- \nDavid\n"},{"id":"285045","messageId":"CAH9ve7yExPFi-k2K87FWsCX0xtx+z8H94L2=YNNz6imXGCEtiA@mail.gmail.com","threadId":"42153","inReplyTo":"20160430011930.GA26977@gmail.com","subject":"Re: using git-difftool -d when cherry-picking","fromName":"Jan Smets","fromEmail":"jan@smets.cx","sentAt":"2016-04-30T10:50:23Z","receivedAt":"2016-04-30T10:50:23Z","isPatch":false,"sender":{"key":"jan@smets.cx","avatar":null},"body":"On Sat, Apr 30, 2016 at 3:19 AM, David Aguilar <davvid@gmail.com> wrote:\n> On Wed, Apr 27, 2016 at 11:12:25AM +0200, Jan Smets wrote:\n>> Hi\n>>\n>> Please consider following example\n>>\n>> #!/bin/bash\n>> rm -rf /tmp/gittest\n>> mkdir /tmp/gittest\n>> cd /tmp/gittest\n>>\n>> git init\n>>\n>> echo $RANDOM > testfile\n>> git add testfile\n>> git commit -m test -a\n>>\n>> git branch X\n>> git checkout X\n>> echo $RANDOM > testfile\n>> git add testfile\n>> git commit -m test -a\n>>\n>> git checkout master\n>> echo $RANDOM > testfile\n>> git add testfile\n>> git commit -m test -a\n>>\n>> git cherry-pick X\n>> git diff --raw\n>> git difftool -d\n>>\n>>\n>> This emulates a merge conflict when using git-cerry-pick.\n>>\n>> $ git diff --raw\n>> :000000 100644 0000000... 0000000... U  testfile\n>> :100644 100644 a04e026... 0000000... M  testfile\n>>\n>> When executing git difftool with the -d option :\n>>\n>> /usr/lib/git-core/git-difftool line 260: File exists\n>>\n>> A possible solution is to build an unique list in @working_tree\n>>\n>> The purpose is to edit/resolve the conflict in the difftool.\n>\n>\n> That could be useful.  git-mergetool is intended to be used when\n> merge conflicts exist, but it sounds like you may have already\n> found a possible solution by making @working_tree unique.  Have\n> you tested that to see if it skirts around the issue?\n>\n> If you have a patch I'd be happy to help review and test it.\n\nSomething like this seems to work.\n\n26a27,32\n> sub uniq\n> {\n>         my %seen;\n>         grep !$seen{$_}++, @_;\n> }\n>\n251a258\n>     my @unique_working_tree = uniq( @working_tree );\n256c263\n<     for my $file (@working_tree) {\n---\n>     for my $file (@unique_working_tree) {\n\nTMTOWTDI\n\nThanks !\n\n-- \nSmets Jan\njan@smets.cx\n"}]}