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

Re: git-clean and empty pathspec

From
Shawn Bohrer <shawn.bohrer@gmail.com>
Date
Dec 7, 2007, 06:14 UTC
Message-ID
<20071207061402.GB21347@mediacenter.austin.rr.com>
In-Reply-To
<fcaeb9bf0712061021o5383f538h3a086a913ac1b05d@mail.gmail.com>
On Fri, Dec 07, 2007 at 01:21:10AM +0700, Nguyen Thai Ngoc Duy wrote:
> "git clean -n" would not remove directories while "git clean -n -- ''"
> (two single quotes) would. Is there anything wrong with it?

It appears that match_pathspec views this as a recursive match to everything, so git clean thinks that you provided the pathspec for all files and directories and thus will remove them.

Without the '' there is no provided pathspec so git clean will not remove the directories without -d.

Note this is different behavior from the old git-clean.sh.
Previous: Nguyen Thai Ngoc Duy
Message 2 of 2 in “git-clean and empty pathspec”
  1. Nguyen Thai Ngoc DuyDec 6, 2007
  2. Shawn BohrerDec 7, 2007

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.