Re: Auto-repo-repair
- From
Jeff King <peff@peff.net>
- Date
- Nov 16, 2012, 19:00 UTC
- Message-ID
- <20121116190004.GA2310@sigill.intra.peff.net>
- In-Reply-To
- <dbae3a06-c14b-4c06-9863-ae4771968fe1@zcs>
On Fri, Nov 16, 2012 at 06:51:45PM +0100, Enrico Weigelt wrote:
Show 8 quoted lines
> I've broken some repo (missing objects), eg by messing something up > w/ alternates, broken filesystem, or whatever. And I've got a bunch > of remotes which (together) contain all of the lost objects. > > Now I'd like to run some $magic_command which automatically fetches > all the missing objects and so repair my local repo. > > Is this already possible right now ?
You can't reliably just grab the broken objects, because most transports don't support grabbing arbitrary objects (you can do it if you have shell access to a known-good repository, but it's not automated).
The simplest thing is usually to re-clone the known-good remotes, then copy the resulting packfiles into your original repository. You'll have duplicated objects until your next "gc", but the resulting repack should skip any corrupted objects and use the known-good ones.
-Peff