git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH 10/10] Enable SHA-256 by default in breaking changes mode
Date: Fri, 20 Jun 2025 21:06:48 +0000	[thread overview]
Message-ID: <aFXNaItMBiPm8t-_@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqa5622lgz.fsf@gitster.g>

[-- Attachment #1: Type: text/plain, Size: 3137 bytes --]

On 2025-06-20 at 20:42:52, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > On 2025-06-20 at 15:03:23, Junio C Hamano wrote:
> >> Another thing that I suspect nobody wrote tests for, but we must be
> >> absolutely certain, is that the post-3.0 Git can still interoperate
> >> well with historical SHA-1 repositories (I am not talking about
> >> "fetch from SHA-1 into SHA-256", but "the binary does not lose
> >> ability to work in SHA-1 repositories or fetch/push between SHA-1
> >> repositories, only because the default is set to SHA-256"), even in
> >> old repositories people have been using for ages without the
> >> core.repositoryformatversion defined.
> >
> > Yes, I have definitely tested that here before sending it out.
> 
> Is there a single t/tXXXX-*.sh test that is dedicated to that
> interoperability, or is it spread across commands (like,
> t????-clone-*.sh has a test that explicitly prepares an SHA-1 and an
> SHA-256 repositories and then tries to clone them with the current
> binary to make sure the result look reasonable, and t????-push-*.sh
> has a test to push between a pair of SHA-1 repositories, and a pair
> of SHA-256 repositories, with the current binary)?

For the dual-hash case, I will add interoperability tests in the future
when we get the interoperability code working and I'll include
same-hash, different-hash, and dual-hash cases.  I'll also make sure
that interop produces the same results in terms of object IDs that a
native single-hash implementation provides.  Right now on that code, I'm
using GIT_DEFAULT_HASH=sha256:sha1 (which I added) to run the testsuite,
which sets up SHA-256 as the main hash and SHA-1 as the compat hash.
I'll add a CI job for that in the future.  (If you're interested, this
code is living in my sha256-interop branch on GitHub and my local
server.)

As far as the tests we have right now that apply to this series, it's
spread across a lot of tests.  There are lots of places in the code that
we clone a repository to make some changes that we don't want to make in
the current repository, for instance, and if clones don't work then
those tests are all broken.  The submodule tests actually add a wide
variety of nested repositories and push and pull them all over the
place, so those also exercise all the cases very well.  We do have clone
and fetch tests, as well as push tests, for local, HTTP, and SSH, so we
do get very comprehensive tests.  Most of those don't specifically
choose different hash algorithms, though (although a few do); they only
work with whatever the testsuite is doing.

Also, while I think some basic interoperability tests are helpful,
there's no substitute for running the entire testsuite in SHA-1 mode
because there are subtle variations in the protocol (e.g., HTTP is
stateless) and there are a lot of non-protocol cases we need to
adequately cover as well (like initializing repositories).  We're not
going to catch all the weird edge cases with a few interoperability
tests.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2025-06-20 21:06 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  1:19 [PATCH 00/10] Add SHA-256 by default as a breaking change brian m. carlson
2025-06-20  1:19 ` [PATCH 01/10] hash: add a constant for the default hash algorithm brian m. carlson
2025-06-20  1:19 ` [PATCH 02/10] hash: add a constant for the original " brian m. carlson
2025-06-20  1:56   ` Junio C Hamano
2025-06-20 20:43     ` brian m. carlson
2025-07-01 11:35       ` Patrick Steinhardt
2025-06-20  1:19 ` [PATCH 03/10] builtin: use default hash when outside a repository brian m. carlson
2025-06-20 14:19   ` Junio C Hamano
2025-07-01 11:35   ` Patrick Steinhardt
2025-07-01 21:14     ` brian m. carlson
2025-07-02 15:08       ` Patrick Steinhardt
2025-06-20  1:19 ` [PATCH 04/10] Use original hash for legacy formats brian m. carlson
2025-06-20 14:26   ` Junio C Hamano
2025-06-20 20:51     ` brian m. carlson
2025-06-20 21:14       ` Junio C Hamano
2025-07-01 11:35         ` Patrick Steinhardt
2025-06-20  1:19 ` [PATCH 05/10] setup: use the default algorithm to initialize repo format brian m. carlson
2025-06-20 14:55   ` Junio C Hamano
2025-06-20 20:28     ` brian m. carlson
2025-06-20 21:05       ` Junio C Hamano
2025-06-20  1:19 ` [PATCH 06/10] t: default to compile-time default hash if not set brian m. carlson
2025-06-20  1:19 ` [PATCH 07/10] t1007: choose the built-in hash outside of a repo brian m. carlson
2025-06-20  1:19 ` [PATCH 08/10] t4042: " brian m. carlson
2025-06-20  1:19 ` [PATCH 09/10] t5300: " brian m. carlson
2025-06-20  1:19 ` [PATCH 10/10] Enable SHA-256 by default in breaking changes mode brian m. carlson
2025-06-20 14:58   ` Junio C Hamano
2025-06-20 19:18     ` brian m. carlson
2025-06-20 15:03   ` Junio C Hamano
2025-06-20 19:15     ` brian m. carlson
2025-06-20 20:42       ` Junio C Hamano
2025-06-20 21:06         ` brian m. carlson [this message]
2025-07-01 11:35   ` Patrick Steinhardt
2025-07-01 21:22 ` [PATCH v2 00/11] Add SHA-256 by default as a breaking change brian m. carlson
2025-07-01 21:22   ` [PATCH v2 01/11] hash: add a constant for the default hash algorithm brian m. carlson
2025-07-01 21:22   ` [PATCH v2 02/11] hash: add a constant for the legacy " brian m. carlson
2025-07-01 21:22   ` [PATCH v2 03/11] builtin: use default hash when outside a repository brian m. carlson
2025-07-01 21:22   ` [PATCH v2 04/11] Use legacy hash for legacy formats brian m. carlson
2025-07-01 21:22   ` [PATCH v2 05/11] setup: use the default algorithm to initialize repo format brian m. carlson
2025-07-01 21:22   ` [PATCH v2 06/11] t: default to compile-time default hash if not set brian m. carlson
2025-07-01 21:22   ` [PATCH v2 07/11] t1007: choose the built-in hash outside of a repo brian m. carlson
2025-07-01 21:22   ` [PATCH v2 08/11] t4042: " brian m. carlson
2025-07-01 21:22   ` [PATCH v2 09/11] t5300: " brian m. carlson
2025-07-01 21:22   ` [PATCH v2 10/11] help: add a build option for default hash brian m. carlson
2025-07-01 21:22   ` [PATCH v2 11/11] Enable SHA-256 by default in breaking changes mode brian m. carlson
2025-07-01 22:10   ` [PATCH v2 00/11] Add SHA-256 by default as a breaking change Junio C Hamano
2025-07-02 14:46   ` Patrick Steinhardt
2025-07-02 15:01     ` Kristoffer Haugsbakk

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=aFXNaItMBiPm8t-_@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /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;
as well as URLs for NNTP newsgroup(s).