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

Re: clean bug on ignored subdirectories with no tracked files?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2011, 19:28 UTC
Message-ID
<7vty5xff6l.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vy5v9fgel.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> Jay Soffian <jaysoffian@gmail.com> writes:
>
>> Just because it is uninteresting to git does not mean that it isn't
>> precious.
>
> That statement is false with the versions of Git so far. See the other
> thread for the current status and possible future directions.

Oops, sorry, I was really confused. You are right that "ignored" for "clean" does not mean "they are not tracked and should be removed". That would result in removal of build artifacts '*.o' and unnecesary recompilation.

What "precious" means is a bit different, however. With verisons of Git so far, what "ignored" means is that they are not tracked, and _can_ be removed when needed to complete normal Git operations. When checking out another branch that has a tracked file at the same path as an untracked and ignored file in your current branch, removal of that ignored file is necessary to complete the checkout, and for that purpose, the ignored file is considered expendable. And we do not have a concept of "precious", unexpendable but untracked file, nor a way to specify that to gitignore mechanism (which is the topic of the other discussion thread).

"clean" without "-x" is meant to preserve untracked but expendable paths (e.g. build products), so if something is removed that is untracked but matches the ignore pattern, then that is a bug to be fixed. Care to roll a patch to fix it?

Sorry for the confusion, but as I said, I do not use (hence nor care much about) "clean" myself, so...

Previous: Junio C HamanoNext: Jay Soffian
Message 5 of 7 in “clean bug on ignored subdirectories with no tracked files?”
  1. Jay SoffianNov 19, 2011
  2. Junio C HamanoNov 19, 2011
  3. Jay SoffianNov 21, 2011
  4. Junio C HamanoNov 21, 2011
  5. Junio C HamanoNov 21, 2011
  6. Jay SoffianNov 21, 2011
  7. Phil HordDec 1, 2011

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.