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

Bug in git clean

From
Jjones.noamle@gmail.com <jones.noamle@gmail.com>
Date
Oct 11, 2013, 19:05 UTC
Message-ID
<CAMUDzVQqUT91OTbC21pke6jzF8kWBZJAvnyvHhrt-O3=y5bJLQ@mail.gmail.com>
Hi.

Passing to git clean wrong (non-existent) paths together with valid ones, causes it to delete stuff that it shouldn't. Am I right? Script to reproduce:

mkdir test cd test git init . mkdir ba mkdir ba/ca

# So far so good. # Should clean directory "ba/ca" git clean -dn -- ba/ca

# Should clean "ba/ca" and ignore non-existent "j" # Instead, it wants to delete "ba" totally. git clean -dn -- ba/ca j

git --version

--------------------------------------------------------------------- Output:

+ mkdir test
+ cd test
+ git init .
Initialized empty Git repository in /home/notroot/test/.git/
+ mkdir ba
+ mkdir ba/ca
+ git clean -dn -- ba/ca
Would remove ba/ca/
+ git clean -dn -- ba/ca j
Would remove ba/
+ git --version
git version 1.7.9.5
---------------------------------------------------------------------
Tested on linux (version 1.7.9.5) and cygwin (1.7.9)

Thanks! Noam Lewis Hadas Nahon

Message 1 of 1 in “Bug in git clean”
  1. jones.noamle@gmail.comOct 11, 2013

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.