git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: distinguishing between staged and unstaged content in a stash?

From
Kevin Daudt <me@ikke.info>
Date
Oct 4, 2017, 15:03 UTC
Message-ID
<20171004150345.GC1667@alpha.vpn.ikke.info>
In-Reply-To
<20171004071046.Horde.89FTNuoUz8wPxhsuejrB03G@crashcourse.ca>
On Wed, Oct 04, 2017 at 07:10:46AM -0400, rpjday@crashcourse.ca wrote:
Show 31 quoted lines
> 
>   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/

Previous: rpjday@crashcourse.caNext: Robert P. J. Day
Message 2 of 3 in “distinguishing between staged and unstaged content in a stash?”
  1. rpjday@crashcourse.caOct 4, 2017
  2. Kevin DaudtOct 4, 2017
  3. Robert P. J. DayOct 4, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.