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

Re: Commit SHA1 == SHA1 checksum?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2022, 10:15 UTC
Message-ID
<xmqq1r0gjo6h.fsf@gitster.g>
In-Reply-To
<121ce485-bea8-3168-aa35-d11eb13022da@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
> The tag contains the sha1 hash of the release commit, which in turn
> contains the sha1 hashes of the tree that is being released, and the 
> previous commit in the git history, and onward the hashes roll...

That's how a signed tag protects the commit it points at, and everything reachable from it. As much or as little trust you have in SHA-1 in validating tarball.tar with its known SHA-1 checksum, you can trust to the same degree that the commit that is pointed by a tag is what the person who signed (with GPG) the tag wanted the tag to point at, and in turn the trees and blobs in that commit are what the signer wanted to have in that tagged commit, ad infinitum, in the space dimension. At the same time, a commit object records the hash of the commit objects that are its parents, the whole history of the project going back to inception can be trusted to the same degree in the time dimension.

Show 5 quoted lines
> https://lore.kernel.org/git/xmqqh7n5zv2b.fsf@gitster.c.googlers.com/ is
> a recent discussion on the refreshing of the PGP key. the post
> https://lore.kernel.org/git/YA3nwFcYz4tbhrlO@camp.crustytoothpaste.net/
> in the thread notes "The signature is .. over the uncompressed
> .tar ... You therefore need to uncompress it first with gunzip."

That thread has very little to do with the way how Git objects are cryptographically protected, which I discussed earlier in this message.

Instead, it was a discussion about how the checksum files and tarballs at

    https://www.kernel.org/pub/software/scm/git/

relate to each other. A typical release tarball for Git version $VERSION has multiple tarballs git-$VERSION.tar.{gz,bz2,xz,...} and they all uncompresses back to the same git-$VERSION.tar tarball.

There is git-$VERSION.tar.sign file next to them in the same directory. The file is supposed to contain a detached signature over the uncompressed version of the archive.

Previous: Johannes SixtNext: Philip Oakley
Message 5 of 19 in “Commit SHA1 == SHA1 checksum?”
  1. Gamblin, ToddFeb 5, 2022
  2. Philip OakleyFeb 6, 2022
  3. Gamblin, ToddFeb 6, 2022
  4. Johannes SixtFeb 6, 2022
  5. Junio C HamanoFeb 6, 2022
  6. Philip OakleyFeb 6, 2022
  7. Junio C HamanoFeb 6, 2022
  8. Philip OakleyFeb 6, 2022
  9. Gamblin, ToddFeb 7, 2022
  10. Konstantin RyabitsevFeb 7, 2022
  11. Gamblin, ToddFeb 7, 2022
  12. Konstantin RyabitsevFeb 7, 2022
  13. Junio C HamanoFeb 7, 2022
  14. Konstantin RyabitsevFeb 7, 2022
  15. Gamblin, ToddFeb 7, 2022
  16. Konstantin RyabitsevFeb 7, 2022
  17. Gamblin, ToddFeb 8, 2022
  18. Junio C HamanoFeb 7, 2022
  19. Konstantin RyabitsevFeb 7, 2022

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.