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

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
Previous: Adam DinwoodieNext: brian m. carlson
Message 2 of 17 in “Default object format for new repositories in Git v3”
  1. Adam DinwoodieNov 6, 2026
  2. brian m. carlsonNov 6, 2026
  3. setup: default hash algo to GIT_HASH_DEFAULTbrian m. carlson, Nov 8, 2026
  4. Junio C HamanoNov 8, 2026
  5. brian m. carlsonNov 8, 2026
  6. Junio C HamanoNov 8, 2026
  7. Junio C HamanoNov 9, 2026
  8. Patrick SteinhardtNov 9, 2026
  9. setup: fix hash algorithm detectionbrian m. carlson, Nov 13, 2026
  10. Junio C HamanoNov 14, 2026
  11. Patrick SteinhardtNov 16, 2026
  12. setup: fix hash algorithm detectionbrian m. carlson, Nov 19, 2026
  13. Patrick SteinhardtNov 19, 2026
  14. Junio C HamanoNov 19, 2026
  15. Junio C HamanoNov 19, 2026
  16. brian m. carlsonNov 19, 2026
  17. Junio C HamanoNov 19, 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.