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

[BUG} stash show does not show untracked files stashed (reposted)

From
Rrandall.s.becker@rogers.com <randall.s.becker@rogers.com>
Date
Aug 29, 2019, 17:33 UTC
Message-ID
<002901d55e8f$e4a4af70$adee0e50$@rogers.com>

I don't know whether this is new behaviour following changes to stash, but here goes.

Suppose I have files a,b,c,d modified, but only file d is in the index. After stash push (or save) --include-untracked, stash show only displays file d. A subsequent pop will restore files a,b,c,d. So functionally push and pop are fine, but stash show appears to ignores files in the stash. The git log below shows a previous commit (dce2e3e) to the WIP stash (ab0834c) that does contain the untracked files, and git diff is happy to show the contents when using the ref directly. It is just counterintuitive for stash show not to display all entries previously pushed. I would have expected symmetry. This is not new.

*-.   ab0834c (refs/stash) WIP on master: bf223fc Updated known
|\ \
| | * dce2e3e untracked files on master: bf223fc Updated known
| * a5ad1ef index on master: bf223fc Updated known
|/
* bf223fc (HEAD -> master) Updated known
* db0efd4 (origin/master, origin/HEAD) initial

This on git 2.23.0. I have the same behaviour on the Windows build of git 2.12.3.

builtins/stash.c show_stash() does not look like it accounts for multiple paths when calling setup_revisions, so I think it is missing the path to the untracked file ref (dce2e32). I am guessing.

Thanks, Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.
Next: Jeff King
Message 1 of 2 in “[BUG} stash show does not show untracked files stashed (reposted)”
  1. randall.s.becker@rogers.comAug 29, 2019
  2. Jeff KingSep 4, 2019

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.