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

Re: [PATCH] Add git-clean command

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:23

Martin Waitz [off-list ref] writes:
quoted
+-x::
+	Don't use the ignore rules.  This allows removing all untracked
+	files, including build products.  This can be used (possibly in
+	conjunction with gitlink:git-reset[1]) to create a pristine
+	working directory to test a clean build.
as ignored files are generally generated files, doesn't it make sense
to clean up the "ignored" files, and leave other untracked files
alone?  That way you don't loose files which you forgot to add to git.
Sounds like a sane suggestion, but my previous comment about
"make clean" broken for people who want this "git clean" feature
applies here as well.

One justification I can think of for "git clean" without -x flag
is to make a clean tree that has only the source and build
products, removing editor backup files, throwaway test output
files and friends, but as you pointed out, this risks losing
newly created source files that you forgot to add, so I would
need a bit of convincing before I use such a command myself.

Compared to that, removing only ignored files sounds like a much
safer operation -- they are explicitly listed as expendable, so
it is a lot less likely to lose anything important.  But again,
that is what "make clean" is there for...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help