On Tue, 20 Mar 2007, Junio C Hamano wrote: > Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes: > > > But to really look at this we should probably add a "really_careful" flag > > that actually re-verifies the SHA1 on read so that we'd catch these kinds > > of corruptions early. > > ... > > I'm hoping somebody has any ideas. We really *could* check the SHA1 on > > each read (and slow down git a lot) and that would catch corruption much > > faster and hopefully pinpoint it more quickly where exactly it happens. > > At least, we could do something like this to catch the breakage > when we (re)pack, to prevent damage from propagating. I think it would be better to retest the SHA1 when we're about to _write_ the object out to the pack, replacing check_pack_inflate() and revalidate_loose_object() with the full SHA1 check, and testing objects which data isn't reused from a pack too. And make it conditional on !pack_to_stdout like we already do of course. Nicolas - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html