Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] stash: Add --clean option to stash and remove all untracked files

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:30

Jeff King [off-list ref] writes:
On Tue, Jun 21, 2011 at 08:28:31AM +0200, Johannes Sixt wrote:
quoted
quoted
I personally think "--untracked" (and -u) is more intuitive too, since it
tells you what "git stash" is about to do. i.e. "git stash" is about to do
the usual stash operation *and* also stash the "untracked" files.
Really?

   $ git stash --untracked

sound like it stashes *only* untracked files. (That by itself may be a
feature that some people want; so far, I'm not among them.)
I would be happy with something that indicated "untracked files in
addition to the regular stash". I just think it should be about "add
these other files into the stash", not "end up in this directory state".

Something like "--untracked-too" fits that, but is horribly ugly.
This I think depends on how you view what stash does. If you concentrate
on the "saving" aspect too much, your naming would start from "untracked"
and end up to be that ugly thing. If you start from "what happens to the
working tree", on the other hand, --clean may not be such a bad name for
what it does.

But I think the previous point you raised about untracked-but-not-ignored
vs untracked-and-ignored is much more important. I do not think anybody
would want to put build products in stash and unstash them later, so in
that sense we can say we would only save the untracked-but-not-ignored in
the stash and remove them, but then "git stash --clean" (or whatever we
end up calling it) would still leave non-source material in the working
tree, which probably does not exactly the original motivation of wanting
to get a pristine source tree without having to trust the build procedure
(i.e. "make clean" may leave cruft behind).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help