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

A couple of questions

From
ISImre Simon <is@ime.usp.br>
Date
Apr 18, 2005, 11:51 UTC
Message-ID
<42639F24.90007@ime.usp.br>
How will git handle a corrupted (git) file system?

For instance, what can be done if objects/xy/z{38} does not pass the simple consistency test, i.e. if the file's sha1 hash is not xyz{38}? This might be a serious problem because, in general, one cannot reconstruct the contents of file objects/xy/z{38} from its name xyz{38}.

Another problem might come up if the file does pass the simple consistency test but the file's contents is not a valid git file, i.e. something that

  (*) successfully inflates to a stream of bytes that forms a sequence of
  <ascii tag without space> + <space> + <ascii decimal size> +
  <byte\0> + <binary object data>.

Are there enough internal redundancies in git to allow fixing at least some corrupted file systems? Shouldn't there be some?

Another related observation is that git is not really based on a 160 bit hashing scheme. Indeed, only files that satisfy the above condition (*) are allowed and this most certainly reduces the valid range of the hashing function. I do not think that this will be a problem, but it doesn't hurt to point this out once.

Cheers,
Imre Simon
Next: Linus Torvalds
Message 1 of 3 in “A couple of questions”
  1. Imre SimonApr 18, 2005
  2. Linus TorvaldsApr 18, 2005
  3. Paul JacksonApr 18, 2005

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.