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

Re: Bug report: Untracked file lost from git stash

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2025, 21:06 UTC
Message-ID
<xmqq4isqfdi9.fsf@gitster.g>
In-Reply-To
<CAJA-u1oORK9b2=mg-s_n6-Jn3VBhe6sqrWg8VN0-MdEOjZGcwg@mail.gmail.com>
Hosam Aly <hosamaly6@gmail.com> writes:
Show 6 quoted lines
> Feature request: I wish that the maintainers would consider changing
> the default value of `stash.showIncludeUntracked` to true. If
> something is stashed and the user asks about it, they should be told
> about it without hiding anything. Consider the case where all the
> stashed files are untracked; `git stash show` currently shows nothing,
> which is very confusing.

Do we include untracked paths in the stash by default without configuration and/or command line option? If we do, then such a change will affect so many folks that it would be possible to do so only at a large version boundary, like Git 3.0.

But untracked paths are not recorded by default, and a stash entry that records the untracked ones is a sign enough that the user cares about these untracked ones when the stash entry was created.

Even though I do dislike any suggestion to change existing behaviour established more than a few years, I would be more sympathetic than usual to a wish for such a change in the default. In other words, I tend to agree that the default should show untracked if recorded. I am actually tempted to argue that the presence of the configuration variable stash.showIncludeUntracked and the "--include-untracked" command line option is a bug ;-) but I won't.

Thanks.
Previous: Hosam Aly
Message 4 of 4 in “Bug report: Untracked file lost from git stash”
  1. Hosam AlySep 24, 2025
  2. D. Ben KnobleSep 24, 2025
  3. Hosam AlySep 25, 2025
  4. Junio C HamanoSep 25, 2025

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.