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

Re: Recovering from repository corruption

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 10, 2008, 21:09 UTC
Message-ID
<alpine.LFD.1.10.0806101403080.3101@woody.linux-foundation.org>
In-Reply-To
<6dbd4d000806101328k1fc913f2ia55c3e44273ec5ad@mail.gmail.com>
On Tue, 10 Jun 2008, Denis Bueno wrote:
Show 7 quoted lines
> >
> > Hmm. Scary. That should *not* have been successful with a corrupt repo.
> >
> > Unless you have done a .grafts file to hide the corruption, or something
> > like that?
> 
> I intended to do that, yes, and I think I was successful.

Ahh, ok. Yes, we should probably re-think our 'grafts' file thing, or at least not document it, because it's actually a wondeful way to just cause more corruption by hiding things (ie if you clone a repo with a grafts file, the result will now have neither the grafts file _nor_ the state that was hidden by it, so the result is guaranteed to be corrupt).

But that explains why your clone worked, and why the resulting repo had different corruption - it avoided the original corruption, but because of the grafts file it avoided it by just not having those commits at all..

> I do have bunches of personal information in the repo, unfortunately.
> The particular *file* involved in the corruption, however, is fine for
> all to view.  Is that useful?

No, almost all the interest is basically in how the whole repo ties together. The individual corrupt files may be interesting, though, ie from your original report:

    error: 320bd6e82267b71dd2ca7043ea3f61dbbca16109: object corrupt or missing
    error: 4d0be2816d5eea5ae2b40990235e2225c1715927: object corrupt or missing
then *if* you have the files
	.git/objects/32/0bd6e82267b71dd2ca7043ea3f61dbbca16109
	.git/objects/4d/0be2816d5eea5ae2b40990235e2225c1715927

then those two files are interesting in themselves (most likely they are not there at all, or are zero-sized, but if you have them, please post them).

And as this was a result of a real filesystem crash, it *is* possible that you have something in the /lost+found directory for that filesystem. If so, those missing files may be found there.

		Linus
Previous: Denis BuenoNext: Denis Bueno
Message 10 of 31 in “Recovering from repository corruption”
  1. Denis BuenoJun 10, 2008
  2. Jakub NarebskiJun 10, 2008
  3. Denis BuenoJun 10, 2008
  4. Jakub NarebskiJun 10, 2008
  5. Denis BuenoJun 10, 2008
  6. Jakub NarebskiJun 10, 2008
  7. Denis BuenoJun 10, 2008
  8. Linus TorvaldsJun 10, 2008
  9. Denis BuenoJun 10, 2008
  10. Linus TorvaldsJun 10, 2008
  11. Denis BuenoJun 10, 2008
  12. Linus TorvaldsJun 10, 2008
  13. Denis BuenoJun 10, 2008
  14. TarmiganJun 10, 2008
  15. Denis BuenoJun 10, 2008
  16. Linus TorvaldsJun 10, 2008
  17. Linus TorvaldsJun 10, 2008
  18. Nicolas PitreJun 11, 2008
  19. Linus TorvaldsJun 11, 2008
  20. Nicolas PitreJun 11, 2008
  21. Denis BuenoJun 10, 2008
  22. Junio C HamanoJun 10, 2008
  23. To graft or not to graft... (Re: Recovering from repository corruption)Stephen R. van den Berg, Jun 11, 2008
  24. Jakub NarebskiJun 11, 2008
  25. Linus TorvaldsJun 11, 2008
  26. Johan HerlandJun 12, 2008
  27. Jeff KingJun 12, 2008
  28. Johan HerlandJun 12, 2008
  29. Stephen R. van den BergJun 12, 2008
  30. Nicolas PitreJun 10, 2008
  31. Denis BuenoJun 10, 2008

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.