From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Adam Dinwoodie <adam@dinwoodie.org>,
Jeff King <peff@peff.net>
Subject: Re: [PATCH] setup: default hash algo to GIT_HASH_DEFAULT
Date: Sun, 8 Nov 2026 14:38:37 +0000 [thread overview]
Message-ID: <avCJbJE7mx_Z2zLY@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqtsls53xr.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]
On 2026-11-08 at 04:42:56, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
> > When we have no other hash algorithm to choose, we set no hash
> > algorithm, which ends up with us defaulting to SHA-1. Instead, default
> > to GIT_HASH_DEFAULT. This means that we will choose SHA-256 in breaking
> > changes mode and in Git 3.0, which is what we want.
> >
> > Reported-by: Adam Dinwoodie <adam@dinwoodie.org>
> > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> > ---
> > setup.c | 2 ++
> > t/t0001-init.sh | 16 ++++++++++++++++
> > 2 files changed, 18 insertions(+)
>
> With Git 3.0, we promised that SHA-1/SHA-256 interop will not have
> to be ready, and that SHA-256 would become the default. And this
> patch would be a good thing to have for the second promise.
>
> But didn't we also discuss "empty/initial repository whose hash
> algorithm is undecided can take a push of either SHA-1 or SHA-256
> payload and that first push can decide and freeze the hash algorithm
> used in the repository" or something along that line?
We discussed that as a possibility, but it requires protocol changes and
nobody has stepped up to implement that. I think Peff was thinking
about maybe implementing that, but I don't think anyone came to a
decision.
> I am wondering if we want to reserve 'HASH_UNKNOWN' for such a "was
> just created, not quite finished initializing yet" state.
I think we concluded that we'd need to initialize a repository to _some_
hash algorithm even if we had the limbo state because otherwise people
could `git init` and then work locally and we need to have some existing
hash algorithm for that case. That would be true even with bare
repositories.
So I think the limbo functionality, if we implemented it, would be a
separate option (maybe `extensions.potentialObjectFormat`?) and this
patch should go in either way.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
Speaking for myself only
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
next prev parent reply other threads:[~2026-11-08 14:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 16:50 Default object format for new repositories in Git v3 Adam Dinwoodie
2026-11-06 20:46 ` brian m. carlson
2026-11-08 1:16 ` [PATCH] setup: default hash algo to GIT_HASH_DEFAULT brian m. carlson
2026-11-08 4:42 ` Junio C Hamano
2026-11-08 14:38 ` brian m. carlson [this message]
2026-11-08 18:22 ` Junio C Hamano
2026-11-09 2:21 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avCJbJE7mx_Z2zLY@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=adam@dinwoodie.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox