{"thread":{"id":"13586","subject":"git mergetool vs stash apply","startedAt":"2008-05-20T08:02:44Z","lastAt":"2008-05-20T12:45:58Z","messageCount":6,"participants":["Alexander Gladysh","Jeff King","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77313","messageId":"c6c947f60805200102h3fd27742vfd9310912907cfa@mail.gmail.com","threadId":"13586","inReplyTo":null,"subject":"git mergetool vs stash apply","fromName":"Alexander Gladysh","fromEmail":"agladysh@gmail.com","sentAt":"2008-05-20T08:02:44Z","receivedAt":"2008-05-20T08:02:44Z","isPatch":false,"sender":{"key":"agladysh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38239?v=4"},"body":"Hi, list!\n\nThe git mergetool ignores conflicts by git stash apply:\n\n$ git stash apply\nAuto-merged path/file.ext\nCONFLICT (content): Merge conflict in path/file.ext\n\n$ git mergetool\nmerge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff\nopendiff emerge vimdiff\nNo files need merging\n\nWhile path/file.ext do contain merge conflict.\n\nThe git mergetool works for git merge and git rebase. Maybe it should\nwork for git stash as well? I automatically type git mergetool when I\nsee CONFLICT in Git output. %-)\n\nAlexander.\n"},{"id":"77315","messageId":"20080520090258.GB31703@sigill.intra.peff.net","threadId":"13586","inReplyTo":"c6c947f60805200102h3fd27742vfd9310912907cfa@mail.gmail.com","subject":"Re: git mergetool vs stash apply","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-05-20T09:02:59Z","receivedAt":"2008-05-20T09:02:59Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 20, 2008 at 12:02:44PM +0400, Alexander Gladysh wrote:\n\n> The git mergetool ignores conflicts by git stash apply:\n> \n> $ git stash apply\n> Auto-merged path/file.ext\n> CONFLICT (content): Merge conflict in path/file.ext\n> \n> $ git mergetool\n> merge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff\n> opendiff emerge vimdiff\n> No files need merging\n> \n> While path/file.ext do contain merge conflict.\n\nI think there is something else going on, because it _does_ generally\nwork. This simple test case should confirm:\n\n  mkdir repo && cd repo && git init\n  echo content >file && git add . && git commit -m one\n  echo changes >>file && git commit -a -m two\n  echo more >>file && git stash\n  git checkout -b other HEAD^\n  echo different changes >>file && git commit -a -m three\n  git stash apply\n  git mergetool\n\nI get:\n  Normal merge conflict for 'file':\n    {local}: modified\n    {remote}: modified\n  Hit return to start merge resolution tool (xxdiff):\n\nSo there is perhaps something specific about your setup or your conflict\nthat is causing mergetool not to work as expected. Can you give us a\ntest case that fails?\n\n-Peff\n"},{"id":"77319","messageId":"c6c947f60805200416s61b0cc1eqd6d6c804abd15b4@mail.gmail.com","threadId":"13586","inReplyTo":"20080520090258.GB31703@sigill.intra.peff.net","subject":"Re: git mergetool vs stash apply","fromName":"Alexander Gladysh","fromEmail":"agladysh@gmail.com","sentAt":"2008-05-20T11:16:47Z","receivedAt":"2008-05-20T11:16:47Z","isPatch":false,"sender":{"key":"agladysh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38239?v=4"},"body":"On Tue, May 20, 2008 at 1:02 PM, Jeff King <peff@peff.net> wrote:\n> On Tue, May 20, 2008 at 12:02:44PM +0400, Alexander Gladysh wrote:\n>\n>> The git mergetool ignores conflicts by git stash apply:\n>>\n>> $ git stash apply\n>> Auto-merged path/file.ext\n>> CONFLICT (content): Merge conflict in path/file.ext\n>>\n>> $ git mergetool\n>> merge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff\n>> opendiff emerge vimdiff\n>> No files need merging\n>>\n>> While path/file.ext do contain merge conflict.\n>\n> I think there is something else going on, because it _does_ generally\n> work. This simple test case should confirm:\n>\n>  mkdir repo && cd repo && git init\n>  echo content >file && git add . && git commit -m one\n>  echo changes >>file && git commit -a -m two\n>  echo more >>file && git stash\n>  git checkout -b other HEAD^\n>  echo different changes >>file && git commit -a -m three\n>  git stash apply\n>  git mergetool\n>\n> I get:\n>  Normal merge conflict for 'file':\n>    {local}: modified\n>    {remote}: modified\n>  Hit return to start merge resolution tool (xxdiff):\n\nYes, I get the that output on clean repo. And I get that output also\nif I use actual conflict data (that is, three snapshots of conflicted\nfile) instead.\n\n> So there is perhaps something specific about your setup or your conflict\n> that is causing mergetool not to work as expected.\n\nMost likely so.\n\n> Can you give us a test case that fails?\n\nNo, unfortunately I can not. I was unable to produce a minimal test\ncase, and I can not share the whole repo.\n\nAlexander.\n"},{"id":"77320","messageId":"m3prrh42hl.fsf@localhost.localdomain","threadId":"13586","inReplyTo":"c6c947f60805200416s61b0cc1eqd6d6c804abd15b4@mail.gmail.com","subject":"Re: git mergetool vs stash apply","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-05-20T11:52:07Z","receivedAt":"2008-05-20T11:52:07Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Alexander Gladysh\" <agladysh@gmail.com> writes:\n\n> On Tue, May 20, 2008 at 1:02 PM, Jeff King <peff@peff.net> wrote:\n>>\n>> So there is perhaps something specific about your setup or your conflict\n>> that is causing mergetool not to work as expected.\n> \n> Most likely so.\n> \n>> Can you give us a test case that fails?\n> \n> No, unfortunately I can not. I was unable to produce a minimal test\n> case, and I can not share the whole repo.\n\nCan you use contents-scrambling tool by Jeff King from\n  Message-ID: <20080510055332.GB11556@sigill.intra.peff.net>\n  http://permalink.gmane.org/gmane.comp.version-control.git/81652\n\nI hope it would be aded at least to contrib when it is tested more...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"77322","messageId":"c6c947f60805200532h53e7ec64jb846f1d8c1b7066c@mail.gmail.com","threadId":"13586","inReplyTo":"m3prrh42hl.fsf@localhost.localdomain","subject":"Re: git mergetool vs stash apply","fromName":"Alexander Gladysh","fromEmail":"agladysh@gmail.com","sentAt":"2008-05-20T12:32:49Z","receivedAt":"2008-05-20T12:32:49Z","isPatch":false,"sender":{"key":"agladysh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38239?v=4"},"body":"On Tue, May 20, 2008 at 3:52 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> \"Alexander Gladysh\" <agladysh@gmail.com> writes:\n>\n>> On Tue, May 20, 2008 at 1:02 PM, Jeff King <peff@peff.net> wrote:\n>>>\n>>> So there is perhaps something specific about your setup or your conflict\n>>> that is causing mergetool not to work as expected.\n>>\n>> Most likely so.\n>>\n>>> Can you give us a test case that fails?\n>>\n>> No, unfortunately I can not. I was unable to produce a minimal test\n>> case, and I can not share the whole repo.\n>\n> Can you use contents-scrambling tool by Jeff King from\n>  Message-ID: <20080510055332.GB11556@sigill.intra.peff.net>\n>  http://permalink.gmane.org/gmane.comp.version-control.git/81652\n\nI have some questions:\n\n1. My repo is 650+ MB, my working copy is 350+ KLOC. That size is hard\nto share. Would that tool reduce it enough? Is it possible to filter\nout irrelevant content somehow?\n2. Would that tool obfuscate binaries as well?\n\nFurthermore, I have tried to reproduce that bug once again (by\nchecking out that problematic revision and trying to apply that git\nstash on it) and was unable to (but my repo has changed since that).\nPerhaps it was some \"moonphase-related\" fluctuation...\n\nSorry for the noise.\nAlexander.\n"},{"id":"77323","messageId":"20080520124557.GA5873@sigill.intra.peff.net","threadId":"13586","inReplyTo":"c6c947f60805200532h53e7ec64jb846f1d8c1b7066c@mail.gmail.com","subject":"Re: git mergetool vs stash apply","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-05-20T12:45:58Z","receivedAt":"2008-05-20T12:45:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 20, 2008 at 04:32:49PM +0400, Alexander Gladysh wrote:\n\n> 1. My repo is 650+ MB, my working copy is 350+ KLOC. That size is hard\n> to share. Would that tool reduce it enough? Is it possible to filter\n> out irrelevant content somehow?\n\nIt doesn't really shrink it very much. You can always filter out some\ncontent with filter-branch, but the trick is trying to produce a repo\nthat still exhibits the problem. In your case, it might be enough to\nsimply provide the stashed state and the state upon which you are trying\nto apply.\n\n> 2. Would that tool obfuscate binaries as well?\n\nIt looks at lines, so wherever your binary happened to have a newline,\nit would get split into chunks. So the answer is yes, it would obfuscate\nthem, but the diffs won't necessarily be meaningful.\n\nAll that being said...\n\n> Furthermore, I have tried to reproduce that bug once again (by\n> checking out that problematic revision and trying to apply that git\n> stash on it) and was unable to (but my repo has changed since that).\n> Perhaps it was some \"moonphase-related\" fluctuation...\n\nObfuscating your repository to let us reproduce is pointless if you\ncan't reproduce on the repository itself. So I would keep an eye on it,\nand if it happens again, try to save the broken state.\n\n-Peff\n"}]}