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

Re: SHA-1/SHA-256 interoperability work is functional

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2026, 20:01 UTC
Message-ID
<xmqqldce2r1a.fsf@gitster.g>
In-Reply-To
<ajCWBG9RHBrm8jMZ@fruit.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 5 quoted lines
> I'm pleased to announce that I have Git fully passing the testsuite and
> CI in interoperability mode, both with SHA-256 and SHA-1 as the main
> algorithm.  While this is very exciting, the work is not ready to send
> to the list and is effectively a draft, since there is still cleanup
> and efficiency work to be done.
Great to hear about a great milestone.
Show 10 quoted lines
> Features which are currently unsupported (and which may or may not be
> supported in the future):
>
> * Filtered bundles are unsupported because there is currently no way to provide
> 	a mapping.
> * Multi-pack index cannot be used as the sole pack index format because it does
> 	not yet provide mappings.
> * Pack index v1 and v2 cannot be used because they do not provide object
> 	mappings.  Git automatically uses pack index v3 instead when necessary, which
> 	does handle mappings.
> * Packfile URIs are not supported because the protocol-provided packfile is not
> 	complete and its objects cannot be mapped.

Not that I specifically care about packfile URI, but this one is curious. How would regular "fetch" and "push" traffic work under the new world order? Presumably we will keep one characteristic of the protocol, that the packdata stream is the only thing that is given to the other side and no object names are given, because the receiving end would not want to blindly trust the object name the sending end _claims_ to have sent and instead recomputes the object name out of the packed objects in the data stream ("if we rehash and recompute the object names from the datastream, the other side cannot lie to us" IIRC was a security measure).

For a regular "fetch" and "push" to work, we would need to recompute the native object names and also somehow compute the compatibility object names if we are in interoperability mode, no?

If we download *.pack files from a packfile URI, wouldn't it be the same story?

> * Large object promisors cannot be used if the server does not actually have
> 	the entire history, since the server must have a complete history in order to
> 	provide object mappings.

Again, this one worries me a bit, but perhaps I am not reading it correctly. Does this mean that the server side says "this is the data for object whose name is X in the SHA-1 world, which translates to X256 in the SHA-256 world", the receiving end blindly trusts without having a way to verify?

Show 13 quoted lines
> There is new documentation in `Documentation/gitformat-hash.adoc` that
> outlines the requirements for using the protocol.  The protocol
> restrictions described there are hard technical limitations that cannot
> be avoided; I've intentionally made things as featureful as they can be.
> This imposes real restrictions on using protocol interoperability with many
> projects, including Git and Linux[0].  Interested parties may wish to look
> at t1017 to see what's tested vis-à-vis the protocol and
> interoperability.
> ...
> If you're interested in testing or perusing the work, you may get it
> from the `sha256-interop` branch of https://github.com/bk2204/git.git.
> Please note that it may be rebased, rewound, or otherwise folded,
> spindled, or mutilated at any time.
Sounds exciting.
Thanks.
Previous: brian m. carlsonNext: brian m. carlson
Message 2 of 3 in “SHA-1/SHA-256 interoperability work is functional”
  1. brian m. carlsonJun 16, 2026
  2. Junio C HamanoJun 16, 2026
  3. brian m. carlsonJun 16, 2026

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.