{"thread":{"id":"23159","subject":"[BUG?] git stash pop results in conflict","startedAt":"2010-03-24T02:01:21Z","lastAt":"2010-03-24T10:34:42Z","messageCount":2,"participants":["Tim Mazid","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137682","messageId":"SNT124-W41E7349234C70B82E8D6BFC4250@phx.gbl","threadId":"23159","inReplyTo":null,"subject":"[BUG?] git stash pop results in conflict","fromName":"Tim Mazid","fromEmail":"timmazid@hotmail.com","sentAt":"2010-03-24T02:01:21Z","receivedAt":"2010-03-24T02:01:21Z","isPatch":false,"sender":{"key":"timmazid@hotmail.com","avatar":null},"body":"\nHi,\n \nI'm not sure if this is a bug or if it should be thus.\n \nBasically, a 'git stash --keep-index' followed immediately by a 'git stash pop' (no changes made) will result in a conflict.\n \nSteps to reproduce:\n \n \nPut\n \n\"AAA\nBBB\nCCC\"\n \ninto file 'test'\n \n$ git add test\n$ git commit -m \"A\"\n \nAppend lines\n \n\"DDD\nEEE\nFFF\nGGG\"\n \ninto file 'test'\n \n$ git add -p\n \nPress 'e' and remove the \"FFF\" and \"GGG\" files from the patch, to stage only the \"DDD\" and \"EEE\" files.\n \n$ git stash --keep-index\n$ git stash pop\n \nCONFLICT\n \n \nI hope that's clear enough.\n \nCheers,\nTim. \t\t \t   \t\t  \n_________________________________________________________________\nLink all your email accounts and social updates with Hotmail. Find out now.\nhttp://windowslive.ninemsn.com.au/oneinbox?ocid=T162MSN05A0710G"},{"id":"137698","messageId":"4BA9EAC2.4020707@drmicha.warpmail.net","threadId":"23159","inReplyTo":"SNT124-W41E7349234C70B82E8D6BFC4250@phx.gbl","subject":"Re: [BUG?] git stash pop results in conflict","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-24T10:34:42Z","receivedAt":"2010-03-24T10:34:42Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Tim Mazid venit, vidit, dixit 24.03.2010 03:01:\n> \n> Hi,\n>  \n> I'm not sure if this is a bug or if it should be thus.\n>  \n> Basically, a 'git stash --keep-index' followed immediately by a 'git stash pop' (no changes made) will result in a conflict.\n>  \n> Steps to reproduce:\n>  \n>  \n> Put\n>  \n> \"AAA\n> BBB\n> CCC\"\n>  \n> into file 'test'\n>  \n> $ git add test\n> $ git commit -m \"A\"\n>  \n> Append lines\n>  \n> \"DDD\n> EEE\n> FFF\n> GGG\"\n>  \n> into file 'test'\n>  \n> $ git add -p\n>  \n> Press 'e' and remove the \"FFF\" and \"GGG\" files from the patch, to stage only the \"DDD\" and \"EEE\" files.\n>  \n> $ git stash --keep-index\n\nRight here, git stash show -p shows that the recorded stash is a merge diff:\n\ndiff --cc test\nindex 7b0e998,988cecb..83b9202\n--- a/test\n+++ b/test\n@@@ -1,3 -1,5 +1,7 @@@\n  AAA\n  BBB\n  CCC\n+ DDD\n+ EEE\n++FFF\n++GGG\n\nThe index still has the following (git diff --staged):\n\ndiff --git c/test i/test\nindex 7b0e998..988cecb 100644\n--- c/test\n+++ i/test\n@@ -1,3 +1,5 @@\n AAA\n BBB\n CCC\n+DDD\n+EEE\n\n> $ git stash pop\n>  \n> CONFLICT\n>  \n>  \n> I hope that's clear enough.\n\ngit diff shows the conflict:\n\ndiff --cc test\nindex 988cecb,83b9202..0000000\n--- i/test\n+++ w/test\n@@@ -3,3 -3,5 +3,8 @@@ BB\n  CCC\n  DDD\n  EEE\n++<<<<<<< Updated upstream\n++=======\n+ FFF\n+ GGG\n++>>>>>>> Stashed changes\n\nAccording to the example in the man page, I would have thought that\ncommitting between save and pop would help, but it produces the same\nproblem. pop --index doesn't help either. Do you happen to know whether\nthis used to work?\n\nMichael\n"}]}