From: Duy Nguyen Date: Sat, 29 Oct 2016 03:30:27 GMT Subject: Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files Message-ID: In-Reply-To: On Thu, Oct 27, 2016 at 11:13 PM, Junio C Hamano wrote: >> git-gc just can't match this because while it's running, somebody else >> may be updating $GIT_DIR/index. Handling races would be a lot harder. > > It could attempt to take a lock on the primary index while it runs, > and refrain to do anything if it can't take the lock ("gc --auto" > may want to silently retry), and then the race is no longer an > issue, no? No, I thought of that. But if gc is holding the lock, another program that wants to update the index may fail. And git-gc is supposed to be non-intrusive -- Duy