sha-1 check in rev-list --verify-objects redundant?
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Feb 25, 2012, 17:15 UTC
- Message-ID
- <CACsJy8D_BdV14dGc2YsK91FrX8S=70DJOY3cU=oH3y41N2Ar0w@mail.gmail.com>
Hi,
"git rev-list --verify-objects" calls parse_object() on all except commits. This function in turn does check_sha1_signature() which rehashes object content to verify the content matches its sha-1 signature. This is an expensive operation. I wonder if this is a redundant check. --verify-objects is called to verify new packs. index-pack is also (always?) called on new packs, and index-pack hashes all object content, saves the hashes as signature in pack index file. So they must match. Am I missing something here?
-- Duy