Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [BUG] git clean -X skips a directory containing only ignored files

From: Michael Schubert <hidden>
Date: 2016-06-15 22:52:54
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

On 01/31/2012 05:20 PM, Andrew Wong wrote:
I think there were a bit of discussions on this issues just while ago too:
http://thread.gmane.org/gmane.comp.version-control.git/188605
Thanks, missed that.

Below a patch with an update for Documentation/git-clean.txt - I'm not sure
if the issue should be described more accurate.?

-- >8 --

Subject: [PATCH] Documentation: tell about "git clean -Xd" bug

"git clean -Xd" doesn't work as expected (delete all ignored files and
untracked directories), because Git's dir subsystem is skipping
directories which both aren't explicitly ignored and don't hold any
tracked files.

Tell about this limitation in BUGS.

Signed-off-by: Michael Schubert <redacted>
---
 Documentation/git-clean.txt |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index 79fb984..888c07d 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -29,7 +29,8 @@ OPTIONS
 	Remove untracked directories in addition to untracked files.
 	If an untracked directory is managed by a different git
 	repository, it is not removed by default.  Use -f option twice
-	if you really want to remove such a directory.
+	if you really want to remove such a directory.  Also see BUGS
+	below.
 
 -f::
 --force::
@@ -63,6 +64,11 @@ OPTIONS
 	Remove only files ignored by git.  This may be useful to rebuild
 	everything from scratch, but keep manually created files.
 
+BUGS
+----
+'git-clean -Xd' doesn't work as expected for directories which don't hold
+any tracked files and aren't explicitly ignored either.
+
 GIT
 ---
 Part of the linkgit:git[1] suite
-- 
1.7.9.174.g356eff6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help