From: Junio C Hamano Date: Fri, 13 Mar 2020 01:14:48 GMT Subject: Re: [PATCH] connected.c: reprepare packs for corner cases Message-ID: In-Reply-To: <7378a863-7e2a-455e-4635-e07938ef3381@gmail.com> Derrick Stolee writes: > I wonder if we could do something more complicated in the long-term, > which was recommended to me by Jeff Hostetler: add the pack to the > packed_git list once we've indexed it. That way, we don't reprepare > and scan the packs one-by-one, but instead we insert to the list > a single pack that we already know about. Yup, that was the first thing that came to my mind, i.e. the code that installs a new packfile on disk in our repository must be ours, so we should be able to tell that code to add the new packfile to the in-core list without having to scan. We may still need to scan when that strategy "fails" to protect against racing with simultaneous repacking, though.