[BUG] git clean does not remove certain directories

2 messages, 1 author, 2016-06-15 · open the first message on its own page

[BUG] git clean does not remove certain directories

From: Soren Brinkmann <hidden>
Date: 2016-06-15 22:55:22

Hi,

this use case may be a little awkward but this is the behavior I see:

I have a repository which has a couple of untracked directories which can also
include git repositories. No submodules, though.
I used 'git clean -xdf' on the top level of this repo to remove everything
untracked in it - including the git repositories in sub-directories.

Since using git 1.8.0 the clean operation seems to be 'broken', as output
indicates all those questionable sub directories are removed - just as in prior
git versions - but in fact they remain untouched and are _not_ removed.

I attached a shell script creating a hierarchy to reproduce the issue.
Executing the script creates the git repo 'repo.git' with a couple of tracked
and untracked dirs/files and two more git repositories within the first one.

If you cd into repo.git and execute 'git clean -xdf' I see the following output:
	Removing repo2.git/
	Removing untracked_dir/

But the directories remain intact when using git 1.8.0.
With git 1.6.3.2 it works as I expected and removes the directories. I'm pretty
sure the 1.7.x versions did the same, but it's no longer installed here.

I can see that this behavior may partially be intended, but the tool output
should match its actions. So, either the directories should be removed, or the
output should state, that they are not removed for what reason whatsoever, IMHO

	Thanks,
	Soren

RE: [BUG] git clean does not remove certain directories

From: Soren Brinkmann <hidden>
Date: 2016-06-15 22:55:22

Hi,

this use case may be a little awkward but this is the behavior I see:

I have a repository which has a couple of untracked directories which can also
include git repositories. No submodules, though.
I used 'git clean -xdf' on the top level of this repo to remove everything
untracked in it - including the git repositories in sub-directories.

Since using git 1.8.0 the clean operation seems to be 'broken', as output
indicates all those questionable sub directories are removed - just as in prior
git versions - but in fact they remain untouched and are _not_ removed.

I attached a shell script creating a hierarchy to reproduce the issue.
Executing the script creates the git repo 'repo.git' with a couple of tracked
and untracked dirs/files and two more git repositories within the first one.

If you cd into repo.git and execute 'git clean -xdf' I see the following output:
      Removing repo2.git/
      Removing untracked_dir/

But the directories remain intact when using git 1.8.0.
With git 1.6.3.2 it works as I expected and removes the
directories. I'm pretty
sure the 1.7.x versions did the same, but it's no longer
installed here.
As additional data point: With git 1.7.9.5 the 'untracked_dir' is deleted, while
'repo2.git' is kept. Output is the same as always, indicating both were deleted.

So, three different git versions gain three different results...

        Soren


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help