git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* distinguishing between staged and unstaged content in a stash?
@ 2017-10-04 11:10 rpjday
  2017-10-04 15:03 ` Kevin Daudt
  0 siblings, 1 reply; 3+ messages in thread
From: rpjday @ 2017-10-04 11:10 UTC (permalink / raw)
  To: git


   couple (admittedly trivial) questions about stashing. first, can i
clarify that when one stashes content, a stash *always* distinguishes
between what was staged, and what was unstaged? that is, when one is
stashing, the "--keep-index" option relates to whether or not staged
changes are left in the index (and, consequently, in the working
directory as well), but that option has no effect on the final content
of the stash, yes? even if "--keep-index" is used, staged content
still ends up in the stash.

   also, is there a simple way to distinguish between the staged and
unstaged contents of a stash (or, more basically, is this even a
useful question to ask)? out of curiosity, i tried to figure out
how to do this, and came up with the following.

to see staged portion of stash@{0}:

   $ git show stash@{0}^2

to see unstaged portion:

   $ git diff stash@{0}^2 stash@{0}

it's not like i have a pressing need to do that, i was just curious
if there's a simpler way to do this, or if this is just not something
people should need to do on a regular basis.

rday




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: distinguishing between staged and unstaged content in a stash?
  2017-10-04 11:10 distinguishing between staged and unstaged content in a stash? rpjday
@ 2017-10-04 15:03 ` Kevin Daudt
  2017-10-04 15:24   ` Robert P. J. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Daudt @ 2017-10-04 15:03 UTC (permalink / raw)
  To: rpjday; +Cc: git

On Wed, Oct 04, 2017 at 07:10:46AM -0400, rpjday@crashcourse.ca wrote:
> 
>   couple (admittedly trivial) questions about stashing. first, can i
> clarify that when one stashes content, a stash *always* distinguishes
> between what was staged, and what was unstaged? that is, when one is
> stashing, the "--keep-index" option relates to whether or not staged
> changes are left in the index (and, consequently, in the working
> directory as well), but that option has no effect on the final content
> of the stash, yes? even if "--keep-index" is used, staged content
> still ends up in the stash.
> 
>   also, is there a simple way to distinguish between the staged and
> unstaged contents of a stash (or, more basically, is this even a
> useful question to ask)? out of curiosity, i tried to figure out
> how to do this, and came up with the following.
> 
> to see staged portion of stash@{0}:
> 
>   $ git show stash@{0}^2
> 
> to see unstaged portion:
> 
>   $ git diff stash@{0}^2 stash@{0}
> 
> it's not like i have a pressing need to do that, i was just curious
> if there's a simpler way to do this, or if this is just not something
> people should need to do on a regular basis.
> 
> rday
> 
> 
> 

There was a recent thread about this[0]. The conclusion is that it's
seen as a good change, someone just needs to supply the patch to do
this. A possible solution was also provided (from before that thread)
here [1]

[0]:https://public-inbox.org/git/1505626069.9625.6.camel@gmail.com/
[1]:https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: distinguishing between staged and unstaged content in a stash?
  2017-10-04 15:03 ` Kevin Daudt
@ 2017-10-04 15:24   ` Robert P. J. Day
  0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2017-10-04 15:24 UTC (permalink / raw)
  To: Kevin Daudt; +Cc: git

On Wed, 4 Oct 2017, Kevin Daudt wrote:

> On Wed, Oct 04, 2017 at 07:10:46AM -0400, rpjday@crashcourse.ca wrote:
> >
> >   couple (admittedly trivial) questions about stashing. first, can
> > i clarify that when one stashes content, a stash *always*
> > distinguishes between what was staged, and what was unstaged? that
> > is, when one is stashing, the "--keep-index" option relates to
> > whether or not staged changes are left in the index (and,
> > consequently, in the working directory as well), but that option
> > has no effect on the final content of the stash, yes? even if
> > "--keep-index" is used, staged content still ends up in the stash.
> >
> >   also, is there a simple way to distinguish between the staged
> > and unstaged contents of a stash (or, more basically, is this even
> > a useful question to ask)? out of curiosity, i tried to figure out
> > how to do this, and came up with the following.
> >
> > to see staged portion of stash@{0}:
> >
> >   $ git show stash@{0}^2
> >
> > to see unstaged portion:
> >
> >   $ git diff stash@{0}^2 stash@{0}
> >
> > it's not like i have a pressing need to do that, i was just
> > curious if there's a simpler way to do this, or if this is just
> > not something people should need to do on a regular basis.
>
> There was a recent thread about this[0]. The conclusion is that it's
> seen as a good change, someone just needs to supply the patch to do
> this. A possible solution was also provided (from before that
> thread) here [1]
>
> [0]:https://public-inbox.org/git/1505626069.9625.6.camel@gmail.com/
> [1]:https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/

  ah, i see immediately what sort of worm can this represents, given
the various possible states of files in the stash:

  * staged and tracked
  * unstaged and tracked
  * untracked but not ignored
  * untracked and ignored

  i will continue reading.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-04 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 11:10 distinguishing between staged and unstaged content in a stash? rpjday
2017-10-04 15:03 ` Kevin Daudt
2017-10-04 15:24   ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).