{"thread":{"id":"25455","subject":"Git Stash stages files if there is a conflict","startedAt":"2010-10-15T20:13:27Z","lastAt":"2010-10-18T17:56:47Z","messageCount":4,"participants":["Pretty Boy Floyd","Tor Arntsen","Eric Raible","Aaron Boxer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153601","messageId":"loom.20101015T220924-952@post.gmane.org","threadId":"25455","inReplyTo":null,"subject":"Git Stash stages files if there is a conflict","fromName":"Pretty Boy Floyd","fromEmail":"boxerab@gmail.com","sentAt":"2010-10-15T20:13:27Z","receivedAt":"2010-10-15T20:13:27Z","isPatch":false,"sender":{"key":"boxerab@gmail.com","avatar":null},"body":"Hello!\n\nI am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,\nall of my stash changes get staged. Is this the correct behaviour? I found it a\nlittle surprising.\n\nAnother question: if I have stashed 10 files, and there is a conflict in one of\nthem, will stash apply abort when it has a conflict, or will it apply all\nnon-conflicted files.\n\n\nFinally, if I do the following:\n\ngit stash\ngit pull\ngit stash apply\n\nand another developer has removed a file that I have stashed, then I am unable\nto apply the stash  on this file. How can I retrieve my changes from the stash?\n\n\nThanks!\n"},{"id":"153705","messageId":"AANLkTimrVgegd4mHsEbhs3O78T=zkF4Ns7F2LMEKjm=C@mail.gmail.com","threadId":"25455","inReplyTo":"loom.20101015T220924-952@post.gmane.org","subject":"Re: Git Stash stages files if there is a conflict","fromName":"Tor Arntsen","fromEmail":"tor@spacetec.no","sentAt":"2010-10-18T09:33:36Z","receivedAt":"2010-10-18T09:33:36Z","isPatch":false,"sender":{"key":"tor@spacetec.no","avatar":null},"body":"On Fri, Oct 15, 2010 at 22:13, Pretty Boy Floyd <boxerab@gmail.com> wrote:\n> Hello!\n>\n> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,\n> all of my stash changes get staged. Is this the correct behaviour? I found it a\n> little surprising.\n\nI have no answer to the above, just noting that I observed exactly the\nsame yesterday (git 1.7.1) and was a little surprised too. Not that it\ncreated any problems as such, just raised eyebrows.\n\n[..]\n\n-Tor\n"},{"id":"153729","messageId":"4CBC8161.3080507@nextest.com","threadId":"25455","inReplyTo":"loom.20101015T220924-952@post.gmane.org","subject":"Re: Git Stash stages files if there is a conflict","fromName":"Eric Raible","fromEmail":"raible@nextest.com","sentAt":"2010-10-18T17:18:25Z","receivedAt":"2010-10-18T17:18:25Z","isPatch":false,"sender":{"key":"raible@nextest.com","avatar":null},"body":"On 11:59 AM, Pretty Boy Floyd wrote:\n> Hello!\n> \n> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,\n> all of my stash changes get staged. Is this the correct behaviour? I found it a\n> little surprising.\n\nMy tests indicate that the same thing happens as with any conflicted merge.\nNamely: non-conflicting changes get staged, and conflicting changes are left\nonly in the working directory (with conflict markers added as appropriate).\n\nSee http://progit.org/book/ch3-2.html#basic_merging,\nespecially the part on conflicts.\n\n> Another question: if I have stashed 10 files, and there is a conflict in one of\n> them, will stash apply abort when it has a conflict, or will it apply all\n> non-conflicted files.\n\nSame as above.  In both cases the stash is unaffected, which allows\nyou to reset and try again.\n\n> Finally, if I do the following:\n> \n> git stash\n> git pull\n> git stash apply\n> \n> and another developer has removed a file that I have stashed, then I am unable\n> to apply the stash  on this file. How can I retrieve my changes from the stash?\n\nOne nice (relatively new feature) is \"git stash branch\", which makes a new\nbranch from an existing stash.\n\nHTH - Eric\n"},{"id":"153733","messageId":"AANLkTinC_e=5RKQ2wiy3NtxmsXkiMYKv1+hXWGXd25Pn@mail.gmail.com","threadId":"25455","inReplyTo":"4CBC8161.3080507@nextest.com","subject":"Re: Git Stash stages files if there is a conflict","fromName":"Aaron Boxer","fromEmail":"boxerab@gmail.com","sentAt":"2010-10-18T17:56:47Z","receivedAt":"2010-10-18T17:56:47Z","isPatch":false,"sender":{"key":"boxerab@gmail.com","avatar":null},"body":"Thanks, Eric. The new git stash branch command you mentioned will come in handy.\n\nFrom a user's perspective, it doesn't make sense to stage unconflicted\nchanges after stash apply.\nWhen I stash changes, these changes are usually not ready for committing.\n\nI suppose git uses the index to differentiate between conflicted and\nunconflicted changes.\nSo, its not a big deal. Just a bit surprising.\n\nThanks again for your help!\n\n\n\n\nOn Mon, Oct 18, 2010 at 1:18 PM, Eric Raible <raible@nextest.com> wrote:\n> On 11:59 AM, Pretty Boy Floyd wrote:\n>> Hello!\n>>\n>> I am running msysgit 1.7.3.1.  If I run stash apply, and there is a conflict,\n>> all of my stash changes get staged. Is this the correct behaviour? I found it a\n>> little surprising.\n>\n> My tests indicate that the same thing happens as with any conflicted merge.\n> Namely: non-conflicting changes get staged, and conflicting changes are left\n> only in the working directory (with conflict markers added as appropriate).\n>\n> See http://progit.org/book/ch3-2.html#basic_merging,\n> especially the part on conflicts.\n>\n>> Another question: if I have stashed 10 files, and there is a conflict in one of\n>> them, will stash apply abort when it has a conflict, or will it apply all\n>> non-conflicted files.\n>\n> Same as above.  In both cases the stash is unaffected, which allows\n> you to reset and try again.\n>\n>> Finally, if I do the following:\n>>\n>> git stash\n>> git pull\n>> git stash apply\n>>\n>> and another developer has removed a file that I have stashed, then I am unable\n>> to apply the stash  on this file. How can I retrieve my changes from the stash?\n>\n> One nice (relatively new feature) is \"git stash branch\", which makes a new\n> branch from an existing stash.\n>\n> HTH - Eric\n>\n"}]}