From: Dmitry Potapov Date: Wed, 05 Mar 2008 23:41:24 GMT Subject: Re: [PATCH] git-clean: correct printing relative path Message-ID: <20080305234124.GD11519@dpotapov.dyndns.org> In-Reply-To: <20080305155943.GB15843@artemis.madism.org> On Wed, Mar 05, 2008 at 04:59:43PM +0100, Pierre Habouzit wrote: > > And as far as it goes for your patch, it misses a #include > "wt-status.h" My bad... I will correct and resend the patch now. > and for me it gives: > > git clean .. > Removing ../ > Removing ../git-clean.patch > Removing ../stFdw8KY > > For a tree that had those unclean entries. > ../git-clean.patch > ../stFdw8KY > > > Removing ../ is clearly wrong both times: it didn't really did that > (my current dir was the 't/' dir in the git repository for that) and I > didn't specified 'git clean -d'. Hmm... when I ran 'git clean' inside of the 't/' directory in the git repository, it did not print any message about removing ../. However, when I did the same in a clean repository where the 't/' directory contained only untracked files then the 't/' directory and all files in it were actually removed even I did not specify '-d'. This happens on both 1.5.4 and master versions. IMHO, removing a directory without '-d' is incorrect. In addition, when I ran 'git clean -n ..' at the top a repository, the current master version of Git though printed the error that '..' is outside the repository, still exited with 0. When I test this with 1.5.4, git clean exists with 128 after printing the error. Bisect blames d089ebaad5315325d67db30176df1bbd7754fda9 for changing the exit code to 0. I will look at git-clean more tomorrow. Dmitry