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

Re: fsck option to remove corrupt objects - why/why not?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 16, 2014, 11:59 UTC
Message-ID
<vpqmw8w6x9q.fsf@anie.imag.fr>
In-Reply-To
<543F0DAE.2050205@optusnet.com.au>
Ben Aveling <bena.001@optusnet.com.au> writes:
> And that seems sensible to me - the object is corrupt, it is unusable,
> the object graph is already broken, we already have big problems,
> removing the corrupt object(s) doesn't create any new problems, and it
> allows the possibility that the damaged objects can be restored.

Removing completely may remove a chance to restore the corrupt object (rather unlikely, but I can imagine fine binary file surgery to un-break a broken object file).

But we could move them out of Git's object directory (a bit like .git/lost-found, we could have .git/corrupt). For unpacked objects, it's trivial (just mv them in the directory). For packed objects, I don't know what happens in case they are corrupt. That would solve essentially any problem that you can solve by removing the file, but it makes the operation reversible.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C Hamano
Message 6 of 6 in “fsck option to remove corrupt objects - why/why not?”
  1. Ben AvelingOct 16, 2014
  2. Johan HerlandOct 16, 2014
  3. Jeff KingOct 16, 2014
  4. Johan HerlandOct 16, 2014
  5. Junio C HamanoOct 16, 2014
  6. Matthieu MoyOct 16, 2014

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.