Re: Auto-repo-repair
- From
- Drew Northup <n1xim.email@gmail.com>
- Date
- Nov 20, 2012, 11:56 UTC
- Message-ID
- <CAM9Z-n=tAcpQHTU7WHhzZkoVL_ar9vcH8G1tKd-026+djAiJ4A@mail.gmail.com>
- In-Reply-To
- <fd162e10-46a8-433c-80b2-c1c4185c2032@zcs>
On Mon, Nov 19, 2012 at 5:35 PM, Enrico Weigelt <enrico.weigelt@vnc.biz> wrote:
Show 15 quoted lines
> >> >> How would the broken repository be sure of what it is missing to >> >> request it from the other side? >> > >> > fsck will find missing objects. >> >> And what about the objects referred to by objects that are missing? > > Will be fetched after multiple iterations. > We could even introduce some 'fsck --autorepair' mode, which triggers > it to fetch any missing object from its remotes. > > Maybe even introduce a concept of peer object stores, which (a bit like > alternates) are asked for objects that arent locally availabe - that > could be even a plain venti store.
I still think that it would make the most sense to do the following (if you insist on some sort of automated repair): (1) Fetch a "good" clone (or clones) into a temporary directory; (2) Cannibalize the objects from it (them); (3) Re-run git fsck and check for still-missing / unreachable items; (4) IF THE RESULT OF (3) IS ACCEPTABLE, run git gc to clean up the mess, discard / "merge" duplicate objects, and fix up the packfiles.
It is step (4) that requires the most user interaction. I could see building up a shell script that does all but (4) nearly automatically. None of this requires modifying Git itself.
-- -Drew Northup -------------------------------------------------------------- "As opposed to vegetable or mineral error?" -John Pescatore, SANS NewsBites Vol. 12 Num. 59