Git 2.45 Begins Landing Code For SHA1 & SHA256 Interoperability For Repositories

Written by Michael Larabel in Programming on 19 April 2024 at 01:54 PM EDT. 13 Comments
Junio Hamano announced the release today of Git 2.45-rc0 as the first test release toward the next version of this distributed version control system. Notable with Git 2.45 is beginning to land SHA1 and SHA256 interoperability work for repositories.

Git 2.45 has been working on various optimizations, various sub-command improvements, and a number of fixes to this tool widely used by open-source developers and others. Catching my interest in the Git 2.45-rc0 announcement was:
"Work to support a repository that work with both SHA-1 and SHA-256 hash algorithms has started."

Git has long supported support for using more secure SHA256 hashes rather than SHA1. Albeit it's not been the default and to date there hasn't been interoperability support for existing repositories that are SHA1-based. But with Git 2.45 the very initial patches have begun landing for supporting the SHA1 and SHA256 interoperability for hashes within the same repository.

Git logo

In particular, merged for Git 2.45-rc0 were some of the patches laid out within the "SHA256 and SHA1 interoperability" patch series. Eric Biederman explained in that Git patch series that has been baking since last year:
"A key part of the hash function transition plan is a way that a single git repository can inter-operate with git repositories whose storage hash function is SHA-1 and git repositories whose storage hash function is SHA-256.

This interoperability can defined in terms of two repositories one whose storage hash function is SHA-1 and another whose storage hash function is SHA-256. Those two repositories receive exactly the same objects, but they store them in different but equivalent ways.

For a repository that has one storage hash function to inter-operate with a repository that has a different storage hash function requires the first repository to be able produce it's objects as if they were stored in the second hash function.

This series of changes focuses on implementing the pieces that allow a repository that uses one storage hash function to produce the objects that would have been stored with a second storage hash function.

The final patch in this series is the addition of a test that creates two repositories one that uses SHA-1 as it's storage hash function and the other that uses SHA-256 as it's storage hash function. Identical operations are performed on the two repositories, and their compatibility objects are compared to verify they are the same. AKA the SHA-1 repository on the fly generates the objects store in the SHA-256 repository, and the SHA-256 repository on the fly generates the objects that are stored in the SHA-1 repository."

Great seeing this initial work by Eric Biederman and Brian Carlson land for the Git 2.45 series! The full list of Git 2.45-rc0 patches can be found via today's release announcement.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week