Interesting effect of choice of pack names

John Arbash Meinel john at arbash-meinel.com
Fri Nov 30 01:25:38 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have to say, I thought this was pretty neat:

% md5sum *.pack
aa3ab464f867aaa3609bc8ba20f1e342  aa3ab464f867aaa3609bc8ba20f1e342.pack
b97fb500a3579929a6e6da220a73e01d  b97fb500a3579929a6e6da220a73e01d.pack
bae81ff18176baa44d1d541fe8e8076c  bae81ff18176baa44d1d541fe8e8076c.pack
...

Having pack files be named after their md5sum does mean that you can implicitly
check for disk corruption with nothing other than md5sum.

We can do it with packs because they are write-once, and we write the content
to a temp name, and rename them into place only when they are finished.

I know it isn't meant to be actually cryptographically sound (otherwise we
should have used sha1 or better).

But it certainly gives a nice finger to say... No, something corrupted your
file. (When we see NULL bytes suddenly appearing in the middle of the file,
like we've seen with knits.)

Thanks for this Robert.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHT2aRJdeBCYSNAAMRAt2MAJ9Qxc0BlqjYq2CpVk2oPg4Y6qKIBgCfW1tH
hqAWx7gq6ODuaaPhBY3ytos=
=VGBM
-----END PGP SIGNATURE-----



More information about the bazaar mailing list