All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pete Harlan <pgit@pcharlan.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Unexpected "clean -Xd" behavior
Date: Sun, 15 Jan 2012 18:00:14 -0800	[thread overview]
Message-ID: <4F1384AE.1050209@pcharlan.com> (raw)

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

             reply	other threads:[~2012-01-16  2:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  2:00 Pete Harlan [this message]
2012-01-19  0:29 ` Unexpected "clean -Xd" behavior Jonathan Nieder
2012-01-19  7:31   ` Nguyen Thai Ngoc Duy
2012-01-19 10:03     ` Jonathan Nieder
2012-01-19 22:12     ` pgit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1384AE.1050209@pcharlan.com \
    --to=pgit@pcharlan.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.