{"thread":{"id":"46900","subject":"distinguishing between staged and unstaged content in a stash?","startedAt":"2017-10-04T11:10:52Z","lastAt":"2017-10-04T15:24:23Z","messageCount":3,"participants":["rpjday@crashcourse.ca","Kevin Daudt","Robert P. J. Day"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"329676","messageId":"20171004071046.Horde.89FTNuoUz8wPxhsuejrB03G@crashcourse.ca","threadId":"46900","inReplyTo":null,"subject":"distinguishing between staged and unstaged content in a stash?","fromName":"","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-10-04T11:10:46Z","receivedAt":"2017-10-04T11:10:52Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n   couple (admittedly trivial) questions about stashing. first, can i\nclarify that when one stashes content, a stash *always* distinguishes\nbetween what was staged, and what was unstaged? that is, when one is\nstashing, the \"--keep-index\" option relates to whether or not staged\nchanges are left in the index (and, consequently, in the working\ndirectory as well), but that option has no effect on the final content\nof the stash, yes? even if \"--keep-index\" is used, staged content\nstill ends up in the stash.\n\n   also, is there a simple way to distinguish between the staged and\nunstaged contents of a stash (or, more basically, is this even a\nuseful question to ask)? out of curiosity, i tried to figure out\nhow to do this, and came up with the following.\n\nto see staged portion of stash@{0}:\n\n   $ git show stash@{0}^2\n\nto see unstaged portion:\n\n   $ git diff stash@{0}^2 stash@{0}\n\nit's not like i have a pressing need to do that, i was just curious\nif there's a simpler way to do this, or if this is just not something\npeople should need to do on a regular basis.\n\nrday\n\n\n\n"},{"id":"329689","messageId":"20171004150345.GC1667@alpha.vpn.ikke.info","threadId":"46900","inReplyTo":"20171004071046.Horde.89FTNuoUz8wPxhsuejrB03G@crashcourse.ca","subject":"Re: distinguishing between staged and unstaged content in a stash?","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2017-10-04T15:03:45Z","receivedAt":"2017-10-04T15:03:53Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Wed, Oct 04, 2017 at 07:10:46AM -0400, rpjday@crashcourse.ca wrote:\n> \n>   couple (admittedly trivial) questions about stashing. first, can i\n> clarify that when one stashes content, a stash *always* distinguishes\n> between what was staged, and what was unstaged? that is, when one is\n> stashing, the \"--keep-index\" option relates to whether or not staged\n> changes are left in the index (and, consequently, in the working\n> directory as well), but that option has no effect on the final content\n> of the stash, yes? even if \"--keep-index\" is used, staged content\n> still ends up in the stash.\n> \n>   also, is there a simple way to distinguish between the staged and\n> unstaged contents of a stash (or, more basically, is this even a\n> useful question to ask)? out of curiosity, i tried to figure out\n> how to do this, and came up with the following.\n> \n> to see staged portion of stash@{0}:\n> \n>   $ git show stash@{0}^2\n> \n> to see unstaged portion:\n> \n>   $ git diff stash@{0}^2 stash@{0}\n> \n> it's not like i have a pressing need to do that, i was just curious\n> if there's a simpler way to do this, or if this is just not something\n> people should need to do on a regular basis.\n> \n> rday\n> \n> \n> \n\nThere was a recent thread about this[0]. The conclusion is that it's\nseen as a good change, someone just needs to supply the patch to do\nthis. A possible solution was also provided (from before that thread)\nhere [1]\n\n[0]:https://public-inbox.org/git/1505626069.9625.6.camel@gmail.com/\n[1]:https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/\n"},{"id":"329691","messageId":"alpine.LFD.2.21.1710041121010.12084@localhost.localdomain","threadId":"46900","inReplyTo":"20171004150345.GC1667@alpha.vpn.ikke.info","subject":"Re: distinguishing between staged and unstaged content in a stash?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-10-04T15:24:14Z","receivedAt":"2017-10-04T15:24:23Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Wed, 4 Oct 2017, Kevin Daudt wrote:\n\n> On Wed, Oct 04, 2017 at 07:10:46AM -0400, rpjday@crashcourse.ca wrote:\n> >\n> >   couple (admittedly trivial) questions about stashing. first, can\n> > i clarify that when one stashes content, a stash *always*\n> > distinguishes between what was staged, and what was unstaged? that\n> > is, when one is stashing, the \"--keep-index\" option relates to\n> > whether or not staged changes are left in the index (and,\n> > consequently, in the working directory as well), but that option\n> > has no effect on the final content of the stash, yes? even if\n> > \"--keep-index\" is used, staged content still ends up in the stash.\n> >\n> >   also, is there a simple way to distinguish between the staged\n> > and unstaged contents of a stash (or, more basically, is this even\n> > a useful question to ask)? out of curiosity, i tried to figure out\n> > how to do this, and came up with the following.\n> >\n> > to see staged portion of stash@{0}:\n> >\n> >   $ git show stash@{0}^2\n> >\n> > to see unstaged portion:\n> >\n> >   $ git diff stash@{0}^2 stash@{0}\n> >\n> > it's not like i have a pressing need to do that, i was just\n> > curious if there's a simpler way to do this, or if this is just\n> > not something people should need to do on a regular basis.\n>\n> There was a recent thread about this[0]. The conclusion is that it's\n> seen as a good change, someone just needs to supply the patch to do\n> this. A possible solution was also provided (from before that\n> thread) here [1]\n>\n> [0]:https://public-inbox.org/git/1505626069.9625.6.camel@gmail.com/\n> [1]:https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/\n\n  ah, i see immediately what sort of worm can this represents, given\nthe various possible states of files in the stash:\n\n  * staged and tracked\n  * unstaged and tracked\n  * untracked but not ignored\n  * untracked and ignored\n\n  i will continue reading.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                        http://crashcourse.ca\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"}]}