From: David Turner <dturner@twopensource.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, David Turner <dturner@twitter.com>
Subject: Re: [PATCH] builtin/clean.c: Handle disappearing files
Date: Thu, 14 May 2015 18:33:59 -0400 [thread overview]
Message-ID: <1431642839.17436.22.camel@ubuntu> (raw)
In-Reply-To: <xmqqbnhmiz78.fsf@gitster.dls.corp.google.com>
On Thu, 2015-05-14 at 15:14 -0700, Junio C Hamano wrote:
> David Turner <dturner@twopensource.com> writes:
>
> >> 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.
But it's totally legit for processes to create and delete files in the
working tree at any time. Maybe I'm editing during the clean, and my
editor creates a backup file (or creates a lock file which it's going to
move on top of my old file).
> 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 ;-).
The problem is that git clean does not finish the job it has done in
this case. So my script would have to retry on error (and every script
that git clean uses would have to so).
next prev parent reply other threads:[~2015-05-14 22:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 21:16 [PATCH] builtin/clean.c: Handle disappearing files David Turner
2015-05-14 21:45 ` Junio C Hamano
2015-05-14 21:52 ` David Turner
2015-05-14 22:14 ` Junio C Hamano
2015-05-14 22:33 ` David Turner [this message]
2015-05-15 5:26 ` Junio C Hamano
2015-05-15 18:13 ` David Turner
2015-05-16 19:21 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431642839.17436.22.camel@ubuntu \
--to=dturner@twopensource.com \
--cc=dturner@twitter.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).