git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unexpected "clean -Xd" behavior
@ 2012-01-16  2:00 Pete Harlan
  2012-01-19  0:29 ` Jonathan Nieder
  0 siblings, 1 reply; 5+ messages in thread
From: Pete Harlan @ 2012-01-16  2:00 UTC (permalink / raw)
  To: Git Mailing List

Hi,

When a directory contains nothing but an ignored subdirectory, that
subdirectory does not get removed by "git clean -Xdf".

For example, in a new directory:

# git init
Initialized empty Git repository in /tmp/foo/.git/
# echo a/ >.gitignore
# git add .gitignore
# git commit -m "Initial commit"
[master (root-commit) c3af24c] Initial commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
# mkdir -p foo/a
# touch foo/a/junk.o
# git status
# On branch master
nothing to commit (working directory clean)
# git clean -Xdn  # <--- DOES NOT MENTION foo/a
# touch foo/x.c
# git clean -Xdn  # <--- DITTO WITH UNTRACKED IN foo
# git add foo/x.c
# git clean -Xdn  # <--- WITH TRACKED IN foo, WILL REMOVE a/
Would remove foo/a/
#

Is this intentional?  It's interfering with my using "git clean" to
remove built objects, which happen to be in a dedicated temporary
subdirectory.

Thanks,

--Pete Harlan
  pgit@pcharlan.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-19 22:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16  2:00 Unexpected "clean -Xd" behavior Pete Harlan
2012-01-19  0:29 ` Jonathan Nieder
2012-01-19  7:31   ` Nguyen Thai Ngoc Duy
2012-01-19 10:03     ` Jonathan Nieder
2012-01-19 22:12     ` pgit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).