From: Patrick Steinhardt <ps@pks.im>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Adam Dinwoodie <adam@dinwoodie.org>
Subject: Re: [PATCH v2] setup: fix hash algorithm detection
Date: Mon, 16 Nov 2026 07:22:53 +0100 [thread overview]
Message-ID: <avqhPfANDZqeWGmo@pks.im> (raw)
In-Reply-To: <20261113221753.3408862-1-sandals@crustytoothpaste.net>
On Fri, Nov 13, 2026 at 10:17:53PM +0000, brian m. carlson wrote:
> diff --git a/setup.c b/setup.c
> index 61bcdafe82..14c6e1a67d 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -2817,19 +2817,20 @@ static void repository_format_configure(struct repository_format *repo_fmt,
> * Otherwise, if the user has specified one on the command line, use it.
> */
This comment is now a bit stale, as it talks about re-initializing the
repository with an incompatible hash algorithm. But that only gets
detected further down now. Do we maybe want to update it to have the
same bulleted list of precedence that we also have for the ref and
object storage formats?
The code changes look as expected to me and resemble what we have for
the two storage formats.
> diff --git a/t/t0001-init.sh b/t/t0001-init.sh
> index f1d227f271..d8244a2dec 100755
> --- a/t/t0001-init.sh
> +++ b/t/t0001-init.sh
> @@ -516,6 +516,22 @@ test_expect_success 're-init from a linked worktree' '
> )
> '
>
> +test_expect_success 'git init uses default object format' '
> + test_when_finished "rm -rf repo" &&
> + (
> + sane_unset GIT_DEFAULT_HASH &&
> + git init repo &&
> + if test_have_prereq WITH_BREAKING_CHANGES
> + then
> + echo sha256
> + else
> + echo sha1
> + fi >expect &&
I think we can just use GIT_TEST_BUILTIN_HASH for this, which detects
the hash via `git verson --build-options`.
Thanks!
Patrick
prev parent reply other threads:[~2026-11-16 6:23 UTC|newest]
Thread overview: 11+ 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
2026-11-08 18:22 ` Junio C Hamano
2026-11-09 2:21 ` Junio C Hamano
2026-11-09 9:54 ` Patrick Steinhardt
2026-11-13 22:17 ` [PATCH v2] setup: fix hash algorithm detection brian m. carlson
2026-11-14 0:16 ` Junio C Hamano
2026-11-16 6:22 ` Patrick Steinhardt [this message]
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=avqhPfANDZqeWGmo@pks.im \
--to=ps@pks.im \
--cc=adam@dinwoodie.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.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