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

Re: git clean deletes negated pathspec if directory causing data loss

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2025, 17:04 UTC
Message-ID
<xmqqms585nik.fsf@gitster.g>
In-Reply-To
<a77f4e6f-86a3-ea15-feb5-4d08636ffd94@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> In case the Git maintainer (whose call it is, ultimately, on which side to
> land regarding above-mentioned options) sides with your interpretation,
> here is a patch to add a regression test demonstrating your use case:
Thanks for an opinion.

As "git clean -X" is not really "my thing", not in the sense that I did not write it (I didn't, except for code clean-ups) but in the sense that I see no good use case for the option and I rarely use it myself, as long as its behaviour can be "explained", like you just did, I do not have preference myself, and no strong motivation to advocate changing it, risking potential disruption on existing users.

Previous: Johannes Schindelin
Message 5 of 5 in “git clean deletes negated pathspec if directory causing data loss”
  1. Devste DevsteOct 5, 2025
  2. Devste DevsteOct 5, 2025
  3. Devste DevsteOct 29, 2025
  4. Johannes SchindelinOct 30, 2025
  5. Junio C HamanoOct 30, 2025

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.