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

Re: Behaviour of 'git stash show' when a stash has untracked files

From
Jeff King <peff@peff.net>
Date
Sep 20, 2017, 19:36 UTC
Message-ID
<20170920193630.l7ifret5dpqgxiwm@sigill.intra.peff.net>
In-Reply-To
<xmqqfubinddb.fsf@gitster.mtv.corp.google.com>
On Wed, Sep 20, 2017 at 02:33:04PM +0900, Junio C Hamano wrote:
Show 20 quoted lines
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> 
> > Some time ago, I stashed a few changes along with untracked files. I
> > almost forgot it until recently. Then I wanted to see what I change I
> > had in the stash. So I did a 'git stash show <num>'. It worked fine but
> > didn't say anything about the untracked files in that stash. That made
> > me wonder where the untracked files I added went. I then applied the
> > stash to see that they were still there but weren't listed in show.
> >
> > I understand that they aren't listed because 'git stash show' is
> > typically a "diff between the stashed state and its original parent" as
> > the documentation says but shouldn't there be at least a message that
> > the stash contains untracked files? Those untracked files are "part of
> > the stash" and I see no way to get information about their presence
> > currently.
> >
> > So, should this behaviour be changed?
> 
> Hmm, crickets tell us that nobody is all that interested in this, it
> seems.
Or sometimes people are just really behind in reading the mailing list. ;)

This seemed familiar, and indeed there was some discussion a few months ago:

  https://public-inbox.org/git/CAOtcWM3mrQEqDnjMipzea7Kp+VueBFsZDL2zcJ=y0wgj9N4Vjw@mail.gmail.com/
I sketched out a possible solution in:
  https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/

though I share your concerns over whether people would be annoyed to see the existing "stash show" output changed.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “Behaviour of 'git stash show' when a stash has untracked files”
  1. Kaartic SivaraamSep 17, 2017
  2. Junio C HamanoSep 20, 2017
  3. Jeff KingSep 20, 2017
  4. Junio C HamanoSep 21, 2017
  5. Jeff KingSep 21, 2017
  6. Kaartic SivaraamSep 23, 2017
  7. Junio C HamanoSep 24, 2017
  8. Kaartic SivaraamSep 23, 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.