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

Re: [PATCH] builtin/clean.c: Handle disappearing files

From
Junio C Hamano <gitster@pobox.com>
Date
May 14, 2015, 22:14 UTC
Message-ID
<xmqqbnhmiz78.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1431640373.17436.16.camel@ubuntu>
David Turner <dturner@twopensource.com> writes:
Show 23 quoted lines
>> For this change to be an improvement that matters, you must be
>> allowing some other process mucking around with the files in your
>> working tree when you run "git clean".  The original catches such
>> situation as an anomaly that the user would want to be aware of (and
>> investigate), but this patch essentially declares that having such a
>> random process touching your working tree from sideways is a normal
>> situation.  I do not think I am willing to make such a declaration
>> myself; I'd rather want to know why other people are touching my
>> working tree while I am working in it.
>
> Our build tool[1] stores statistics in a hidden file in the working
> tree.  After it runs, it daemonizes and uploads those stats, and then
> deletes the stats file.  Because the upload might take some time, the
> user might run git clean in the meantime.  (I think there might be some
> other deletion that happens in the background too; I haven't really
> investigated).
>
> Of course, in interactive use, very little harm is done if clean dies
> here: the user simply must notice that the clean has failed and retry
> it.  But in non-interactive use, scripts could fail.
>
> At least, I think that's what could be causing us to hit this error; I
> haven't actually done any research to see if this is true.
I find that the above argues that this patch is a bad idea.

The change sweeps the problem under the rug, killing the canary in the mine, instead of motivating you to figure out why it is happening to you.

Of course, scripts could choose to ignore errors from "git clean" it runs. At that point, the "sweeping under the rug" ugliness is not in Git, which is better ;-).

Previous: David TurnerNext: David Turner
Message 4 of 8 in “builtin/clean.c: Handle disappearing files”
  1. builtin/clean.c: Handle disappearing filesDavid Turner, May 14, 2015
  2. Junio C HamanoMay 14, 2015
  3. David TurnerMay 14, 2015
  4. Junio C HamanoMay 14, 2015
  5. David TurnerMay 14, 2015
  6. Junio C HamanoMay 15, 2015
  7. David TurnerMay 15, 2015
  8. Junio C HamanoMay 16, 2015

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.