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

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
Next: Junio C Hamano
Message 1 of 9 in “sha-1 check in rev-list --verify-objects redundant?”
  1. Nguyen Thai Ngoc DuyFeb 25, 2012
  2. Junio C HamanoFeb 26, 2012
  3. Junio C HamanoFeb 26, 2012
  4. Nguyen Thai Ngoc DuyFeb 26, 2012
  5. Junio C HamanoFeb 26, 2012
  6. Nguyen Thai Ngoc DuyFeb 27, 2012
  7. Junio C HamanoFeb 27, 2012
  8. Nguyen Thai Ngoc DuyFeb 27, 2012
  9. Junio C HamanoFeb 27, 2012

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.