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

Plan for SHA-256 repos to support SHA-1?

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Jun 26, 2022, 00:09 UTC
Message-ID
<87czewxp2u.fsf_-_@email.froward.int.ebiederm.org>
In-Reply-To
<YrbNIUnftj+Ooumo@tapette.crustytoothpaste.net>

Is there at this point a solid plan for how SHA-256 repos will support access SHA-1 only clients?

I remember reading a discussion of having a table somewhere that would translate SHA-256 to SHA-1 when needed.

I had a brainstorm which is probably the uniformed opinion of an outsider.

I was thinking in server settings that a well-packed pack of all of the objects is kept to make it quick for git clone to do it's work.

I was thinking perhaps in a repo that wanted to support access from SHA-1 clients it might makes sense to have three packs instead of the standard 1.

A pack of all of the blobs with no oid references. So that either a SHA-256 or a SHA-1 client could consume it (modulo header changes that are needed).

The pack of blobs could have both an ordinary SHA-256 index and a SHA-1 index.

Then there could be two packs of metadata (aka trees and commits and tags that embed oids). One pack in SHA-256 and one pack in SHA-1.

Then with a little header surgery git clone could be served with sendfile and gluing the pack of blobs and pack of object together.

In the normal end user client case that is doesn't seem to make a lot of sense as all that is needed is to figure out which oid to use and always display SHA-256.

My naivete suggests that just keeping the SHA-1 metadata in a SHA-256 repo could be simple enough to implement that it would allow the transition to start happening, and it could be optimized away later.

Eric
Previous: brian m. carlsonNext: Junio C Hamano
Message 18 of 21 in “SHA-256 transition”
  1. Stephen SmithJun 20, 2022
  2. rsbecker@nexbridge.comJun 20, 2022
  3. Ævar Arnfjörð BjarmasonJun 21, 2022
  4. rsbecker@nexbridge.comJun 21, 2022
  5. Ævar Arnfjörð BjarmasonJun 21, 2022
  6. brian m. carlsonJun 22, 2022
  7. Stephen SmithJun 23, 2022
  8. brian m. carlsonJun 23, 2022
  9. Junio C HamanoJun 23, 2022
  10. Ævar Arnfjörð BjarmasonJun 23, 2022
  11. Kyle MeyerJun 24, 2022
  12. Stephen SmithJun 24, 2022
  13. Ævar Arnfjörð BjarmasonJun 24, 2022
  14. Jonathan CorbetJun 24, 2022
  15. Jeff KingJun 24, 2022
  16. Ævar Arnfjörð BjarmasonJun 24, 2022
  17. brian m. carlsonJun 25, 2022
  18. Plan for SHA-256 repos to support SHA-1?Eric W. Biederman, Jun 26, 2022
  19. Junio C HamanoJun 26, 2022
  20. brian m. carlsonJun 26, 2022
  21. Jeff KingJul 1, 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.