git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-clean: correct printing relative path

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Mar 5, 2008, 23:41 UTC
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.
Show 15 quoted lines
> 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
Previous: Pierre HabouzitNext: Junio C Hamano
Message 6 of 7 in “[bug] git-clean”
  1. Pierre HabouzitMar 5, 2008
  2. git-clean: correct printing relative pathDmitry Potapov, Mar 5, 2008
  3. git-clean: correct printing relative pathDmitry Potapov, Mar 5, 2008
  4. Pierre HabouzitMar 5, 2008
  5. Pierre HabouzitMar 5, 2008
  6. Dmitry PotapovMar 5, 2008
  7. Junio C HamanoMar 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.