Re: Protecting old temporary objects being reused from concurrent "git gc"?
- From
Matt McCutchen <matt@mattmccutchen.net>
- Date
- Nov 15, 2016, 17:33 UTC
- Message-ID
- <1479231184.2406.88.camel@mattmccutchen.net>
- In-Reply-To
- <20161115170634.ichqrqbhmpv2dsiw@sigill.intra.peff.net>
On Tue, 2016-11-15 at 12:06 -0500, Jeff King wrote:
> - when an object write is optimized out because we already have the > object, git will update the mtime on the file (loose object or > packfile) to freshen it
FWIW, I am not seeing this happen when I do "git read-tree --prefix" followed by "git write-tree" using the current master (3ab2281). See the attached test script.
> If you have long-running data (like, a temporary index file that might > literally sit around for days or weeks) I think that is a potential > problem. And the solution is probably to use refs in some way to point > to your objects.
Agreed. This is not my current scenario.
Show 11 quoted lines
> If you're worried about a short-term operation where > somebody happens to run git-gc concurrently, I agree it's a possible > problem, but I suspect something you can ignore in practice. > > For the most part, a lot of the client-side git tools assume that one > operation is happening at a time in the repository. And I think that > largely holds for a developer working on a single clone, and things just > work in practice. > > Auto-gc makes that a little sketchier, but historically does not seem to > have really caused problems in practice.
OK. I'll write a patch to add a summary of this information to the git-gc man page.
Matt