Re: Bug in .gitignore handling
From: Tommy Thorn <hidden>
Date: 2016-06-15 22:44:26
Junio C Hamano wrote:
Are you talking about d6b8fc3 (gitignore(5): Allow "foo/" in ignore list to match directory "foo", 2008-01-31), specifically this part of the manual?
Yes, thanks.
"git clean" has always been an ugly and unreliable stepchild, and I would not be surprised at all if it is ridden with corner case bugs, especially around the area to skip untracked directories; but in this case you are not dealing with a directory but a symlink, and it should not get confused by the fact that the symlink happens to point at a directory.
Thanks, but first step is in ensuring that my understanding is correct. Here's the gist of the test case: mkdir mydir cd mydir git init mkdir mousetrap touch mousetrap/nonempty git add mousetrap/nonempty git commit -m "initial" ln -s ../otherdir/foo . echo "foo/" > .gitignore echo ".gitignore" >> .gitignore git clean -n -f -d I expect the last command to report "Would remove mousetrap/foo/", but I currently get "Would remove foo". Thanks, Tommy