{"thread":{"id":"32156","subject":"[BUG] git clean does not remove certain directories","startedAt":"2012-11-21T00:05:53Z","lastAt":"2012-11-21T05:02:11Z","messageCount":2,"participants":["Soren Brinkmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203586","messageId":"933d806a-abce-4baf-8c3b-9b6742cb8ac7@VA3EHSMHS004.ehs.local","threadId":"32156","inReplyTo":null,"subject":"[BUG] git clean does not remove certain directories","fromName":"Soren Brinkmann","fromEmail":"soren.brinkmann@xilinx.com","sentAt":"2012-11-21T00:05:53Z","receivedAt":"2012-11-21T00:05:53Z","isPatch":false,"sender":{"key":"soren.brinkmann@xilinx.com","avatar":null},"body":"Hi,\n\nthis use case may be a little awkward but this is the behavior I see:\n\nI have a repository which has a couple of untracked directories which can also\ninclude git repositories. No submodules, though.\nI used 'git clean -xdf' on the top level of this repo to remove everything\nuntracked in it - including the git repositories in sub-directories.\n\nSince using git 1.8.0 the clean operation seems to be 'broken', as output\nindicates all those questionable sub directories are removed - just as in prior\ngit versions - but in fact they remain untouched and are _not_ removed.\n\nI attached a shell script creating a hierarchy to reproduce the issue.\nExecuting the script creates the git repo 'repo.git' with a couple of tracked\nand untracked dirs/files and two more git repositories within the first one.\n\nIf you cd into repo.git and execute 'git clean -xdf' I see the following output:\n\tRemoving repo2.git/\n\tRemoving untracked_dir/\n\nBut the directories remain intact when using git 1.8.0.\nWith git 1.6.3.2 it works as I expected and removes the directories. I'm pretty\nsure the 1.7.x versions did the same, but it's no longer installed here.\n\nI can see that this behavior may partially be intended, but the tool output\nshould match its actions. So, either the directories should be removed, or the\noutput should state, that they are not removed for what reason whatsoever, IMHO\n\n\tThanks,\n\tSoren\n\n\n\n#!/bin/sh\nmkdir repo.git\ncd repo.git\ngit init\necho foo > tracked_file1\ngit add tracked_file1\nmkdir tracked_dir\necho foo > tracked_dir/tracked_file2\ngit add tracked_dir/tracked_file2\ngit commit -m \"Adding tracked files\"\nmkdir repo2.git\necho foo > repo2.git/tracked_file3\nmkdir -p untracked_dir/repo3.git\necho foo > untracked_dir/repo3.git/tracked_file4\ncd repo2.git\ngit init\ngit add tracked_file3\ngit commit -m \"Adding file to subrepo1\"\ncd ../untracked_dir/repo3.git\ngit init\ngit add tracked_file4\ngit commit -m \"Adding file to subrepo2\"\ncd ../..\n\n"},{"id":"203594","messageId":"1c18081c-baa9-4e1a-b463-ae7abf787f1c@CO1EHSMHS004.ehs.local","threadId":"32156","inReplyTo":"933d806a-abce-4baf-8c3b-9b6742cb8ac7@VA3EHSMHS004.ehs.local","subject":"RE: [BUG] git clean does not remove certain directories","fromName":"Soren Brinkmann","fromEmail":"soren.brinkmann@xilinx.com","sentAt":"2012-11-21T05:02:11Z","receivedAt":"2012-11-21T05:02:11Z","isPatch":false,"sender":{"key":"soren.brinkmann@xilinx.com","avatar":null},"body":"> Hi,\n>\n> this use case may be a little awkward but this is the behavior I see:\n>\n> I have a repository which has a couple of untracked directories which can also\n> include git repositories. No submodules, though.\n> I used 'git clean -xdf' on the top level of this repo to remove everything\n> untracked in it - including the git repositories in sub-directories.\n>\n> Since using git 1.8.0 the clean operation seems to be 'broken', as output\n> indicates all those questionable sub directories are removed - just as in prior\n> git versions - but in fact they remain untouched and are _not_ removed.\n>\n> I attached a shell script creating a hierarchy to reproduce the issue.\n> Executing the script creates the git repo 'repo.git' with a couple of tracked\n> and untracked dirs/files and two more git repositories within the first one.\n>\n> If you cd into repo.git and execute 'git clean -xdf' I see the following output:\n>       Removing repo2.git/\n>       Removing untracked_dir/\n>\n> But the directories remain intact when using git 1.8.0.\n> With git 1.6.3.2 it works as I expected and removes the\n> directories. I'm pretty\n> sure the 1.7.x versions did the same, but it's no longer\n> installed here.\n\nAs additional data point: With git 1.7.9.5 the 'untracked_dir' is deleted, while\n'repo2.git' is kept. Output is the same as always, indicating both were deleted.\n\nSo, three different git versions gain three different results...\n\n        Soren\n\n\nThis 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.\n"}]}