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

Re: how to remove unreachable objects?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2011, 00:40 UTC
Message-ID
<7vfwjs82sc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110919225219.GD4056@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
>> One possible use case might be when your repository is corrupt, and does
>> not pass "git fsck" (without any argument).  In such a case, if you are
>> lucky and your disk corrupted objects only reachable from a recent topic
>> branch, you might find that this command:
>> 
>> 	$ git fsck master next ...list other topics here...
>> 
>> still succeeds, so that you can figure out which topic makes such a
>> limited fsck fail when it is listed on the command line, judge its
>> importance and resurrect what you can from there, before nuking it to
>> bring the repository back in health so that you can recreate the topic.
>
> Does that work? I had the impression from the documentation that the
> arguments are purely about the reachability analysis, and that the
> actual corruption/correctness checks actually look through the object db
> directly, making sure each object is well-formed. Skimming cmd_fsck
> seems to confirm that.

You are right that you may see "corrupt object" for unreachable from the tips in the object store, but I was talking more about verifying everything that is needed for reachability analysis from the given tips can be read, iow, "missing object" errors, lack of which would mean you can salvage everything reachable from the refs involved in the traversal.

Previous: Jeff KingNext: Jeff King
Message 6 of 9 in “how to remove unreachable objects?”
  1. dieter@schoen.or.atSep 19, 2011
  2. Jeff KingSep 19, 2011
  3. Jeff KingSep 19, 2011
  4. Junio C HamanoSep 19, 2011
  5. Jeff KingSep 19, 2011
  6. Junio C HamanoSep 20, 2011
  7. Jeff KingSep 20, 2011
  8. Dieter SchönSep 24, 2011
  9. Andreas SchwabSep 19, 2011

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.