git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Enrico WeigeltNext: Enrico Weigelt
Message 2 of 9 in “Auto-repo-repair”
  1. Enrico WeigeltNov 16, 2012
  2. Jeff KingNov 16, 2012
  3. Enrico WeigeltNov 17, 2012
  4. Drew NorthupNov 18, 2012
  5. Enrico WeigeltNov 18, 2012
  6. Drew NorthupNov 19, 2012
  7. Enrico WeigeltNov 19, 2012
  8. Drew NorthupNov 20, 2012
  9. Enrico WeigeltNov 22, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.