Re: Default object format for new repositories in Git v3
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Nov 6, 2026, 20:46 UTC
- Message-ID
- <au48oHXom4FGzwb9@fruit.crustytoothpaste.net>
- In-Reply-To
- <CA+kUOampvjU3=VK3VGhYw2L5-E+LBsk=Q0UrAxhhR7hC5SUdJg@mail.gmail.com>
On 2026-11-06 at 16:50:03, Adam Dinwoodie wrote:
Show 23 quoted lines
> Hi folks, > > As part of preparing for Git v3, in particular for Nixpkgs, I've been > running a bunch of tests using Git built with > `WITH_BREAKING_CHANGES=1`. Somewhat to my surprise, `git init` seems > to still be creating new repositories using sha1 rather than sha256. > Is this expected? > > For reference, I've attached the test script I've produced as a repro > that can be run from the root of a Git checkout, although it does > require Nix. I've confirmed the behaviour at v2.56.0, next > (972d6e3ab651d838b30a8d5d70d8ef6ced05a986) and main > (0ffa3e35c7c82ab8d0de226149fb03b3f7674d05). > > For a simpler repro that doesn't require Nix, build Git with > `WITH_BREAKING_CHANGES=1`, then run: > > ``` > git init tmpdir > git -C tmpdir rev-parse --show-object-format > ``` > > This will print "sha1", when I'd expect "sha256".
This does appear to be broken. I have a patch that should fix it that's running through CI right now. I'll send it once it's green, either later tonight or tomorrow.
-- brian m. carlson (they/them) Toronto, Ontario, CA Speaking for myself only