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

Re: Unexpected "clean -Xd" behavior

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 19, 2012, 10:03 UTC
Message-ID
<20120119100317.GA15386@burratino>
In-Reply-To
<CACsJy8AE+rwmOVUZez5GRXRHJsTy+W8ekzr59NTd7_C+gB0Byw@mail.gmail.com>
Nguyen Thai Ngoc Duy wrote:
> -X is to remove ignored files _only_ (DIR_SHOW_IGNORED flag). And
> "foo" is not ignored according to .gitignore, so it cuts short there
> and never gets to "foo/a". -x works.
Makes sense.

I guess the internal logic is that "git clean -fdX" cleans up files that "git clean -fd" would miss, and this is not such a file ("git clean -fd" removes it). But as Pete mentioned, in this edge case the behavior renders "git clean -fdX" less effective than expected at its primary task as poor man's "make clean".

I'd be happy to see a patch that moves to a different set of semantics or an addition to t/t7300-clean.sh and BUGS section in Documentation/git-clean.txt explaining the current limitations, if someone wants to work on that.

Thanks, both. Jonathan

Previous: Nguyen Thai Ngoc DuyNext: pgit@pcharlan.com
Message 4 of 5 in “Unexpected "clean -Xd" behavior”
  1. Pete HarlanJan 16, 2012
  2. Jonathan NiederJan 19, 2012
  3. Nguyen Thai Ngoc DuyJan 19, 2012
  4. Jonathan NiederJan 19, 2012
  5. pgit@pcharlan.comJan 19, 2012

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.