On Thu, Oct 27, 2016 at 11:13 PM, Junio C Hamano <gitster@xxxxxxxxx> 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