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

Re: weaning distributions off tarballs: extended verification of git tags

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 2, 2015, 20:08 UTC
Message-ID
<xmqqwq2z9n7c.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54F4BC18.5060702@vilain.net>
Sam Vilain <sam@vilain.net> writes:
Show 9 quoted lines
>> As to the implementation, checksumming the collection of raw objects is
>> certainly superior to tar. Colin had suggested sorting the objects by
>> checksum, but I don't think that is necessary. Just stream the commit
>> object, then its tree object, followed by the content of each object
>> listed in the tree, recursing into subtrees as necessary. That will be a
>> stable stream for a given commit, or tree.
>
> I would really just do it exactly the same way that git does: checksum
> the objects including their headers with the new hashes.

I tend to agree that it is a good idea. I also suspect that would make the implementation simpler by allowing it to share more code, but I didn't look into it too deeply.

Show 6 quoted lines
> I have a
> hazy recollection of what it would take to replace SHA-1 in git with
> something else; it should be possible (though tricky) to do it lazily,
> where a tree entry has bits (eg, some of the currently unused file
> mode bits) to denotes which hash algorithm is in use for the entry.
> However I don't think that got past idea stage...

I think one reason why it didn't was because it would not work well. That "bit that tells this is a new object or old" would mean that a single tree can have many different object names, depending on which of its component entries are using that bit and which aren't. There goes the "we know two trees with the same object name are identical without recursing into them" optimization out the window.

Also it would make it impossible to do what you suggest to Joey to do, i.e. "exactly the same way that git does", once you start saying that a tree object can be encoded in more than one different ways, wouldn't it?

Previous: Sam VilainNext: Sam Vilain
Message 7 of 13 in “weaning distributions off tarballs: extended verification of git tags”
  1. Colin WaltersFeb 28, 2015
  2. brian m. carlsonFeb 28, 2015
  3. Morten WelinderFeb 28, 2015
  4. Colin WaltersMar 2, 2015
  5. Joey HessMar 2, 2015
  6. Sam VilainMar 2, 2015
  7. Junio C HamanoMar 2, 2015
  8. Sam VilainMar 2, 2015
  9. Duy NguyenMar 2, 2015
  10. Junio C HamanoMar 2, 2015
  11. Duy NguyenMar 3, 2015
  12. Michael HaggertyMar 5, 2015
  13. Colin WaltersJul 8, 2015

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.