Git 2.42 Released With Less Warnings For SHA-256 Usage

Written by Michael Larabel in Programming on 21 August 2023 at 02:53 PM EDT. 11 Comments
PROGRAMMING
Git 2.42 is out today as the newest feature update for this dominant open-source distributed revision control system.

For years now Git developers have been working on experimental SHA-256 support in place of SHA-1 for commit hashes. SHA-256 increases the security of repositories and less likely to potentially encounter any sort of collisions. They hope to eventually migrate to SHA-256 while for now SHA1 remains the default unless explicitly specified with --object-format=sha256. With Git 2.42 though they have begun to reduce the warnings for those making use of SHA-256 repositories.

Developers toned down the SHA-256 warnings now that they don't plan to make any breaking changes around SHA-256 repositories. Thus messages like "THIS VARIABLE IS EXPERIMENTAL!" have been removed. The general SHA-256 object format message has also been changed from:
"THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and still in an early stage. A SHA-256 repository will in general not be able to share work with "regular" SHA-1 repositories. It should be assumed that, e.g., Git internal file formats in relation to SHA-256 repositories may change in backwards-incompatible ways. Only use`--object-format=sha256` for testing purposes."

To now the toned down message of the SHA-256 support as:
"Note: At present, there is no interoperability between SHA-256 repositories and SHA-1 repositories.

Historically, we warned that SHA-256 repositories may later need backward incompatible changes when we introduce such interoperability features. Today, we only expect compatible changes. Furthermore, if such changes prove to be necessary, it can be expected that SHA-256 repositories created with today's Git will be usable by future versions of Git without data loss."

So while SHA-256 isn't yet the default with Git, moving forward it should be maintained in a compatible manner.

Git logo


Git 2.42 also has various Windows updates, adjustments for OpenSSL 3+, expanding the git var information output, and other mostly small changes. More details on the Git 2.42 changes via the release announcement.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com 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 OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week