Thread (1 message) 1 message, 1 author, 2025-09-25

Re: Bug report: Untracked file lost from git stash

From: Junio C Hamano <hidden>
Date: 2025-09-25 21:06:41

Hosam Aly [off-list ref] writes:
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.



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help