From: Mihai Cosma Date: Thu, 22 Oct 2026 18:49:06 GMT Subject: Re: [PATCH v2 0/4] Wait for the index lock instead of failing Message-ID: <20261022184906.3679783-1-mcosma@gmail.com> In-Reply-To: <20261017073231.3357477-1-quark.zju@gmail.com> Hi Jun, I've been working on the same problem from the status side and just sent a two-patch series: https://lore.kernel.org/git/20261022184420.3648771-1-mcosma@gmail.com/ Status takes index.lock before collecting and holds it to the end, even when it has nothing to write, so it's often the process "git add" and "git commit" end up waiting on. My series makes it lock only to write. On top of your v2, in a gcc checkout with status running in a loop, the slowest of 200 "git add" runs went from 1020 ms (one hit your 1s timeout) to 160 ms. The two only conflict on the lock call in cmd_status() that your 1/4 renames, so whichever lands second can pick up the other's change. My first patch also makes repo_update_index_if_able()'s check work under index.skipHash, which the read-then-lock callers your series leaves alone rely on. Thanks, Mihai