All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Eric Wong <e@80x24.org>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] remote-curl: fix clone on sha256 repos
Date: Tue, 11 May 2021 14:25:58 -0400	[thread overview]
Message-ID: <YJrMNmH92mKrIX0N@coredump.intra.peff.net> (raw)
In-Reply-To: <874kf9tjgj.fsf@evledraar.gmail.com>

On Tue, May 11, 2021 at 04:47:28PM +0200, Ævar Arnfjörð Bjarmason wrote:

> 
> On Tue, May 11 2021, Eric Wong wrote:
> 
> > I'm not very familiar with the way some of this stuff works, but
> > the patch below seems to fix clone for me.
> 
> Me neither, but it seems that whatever issue we have here we've got a
> big blind spot in our test suite.
> 
> GIT_SMART_HTTP in the environment will be ignored by test-lib.sh,
> manually changing the code to use it leads to a lot of test failures,
> some are definitely expected (incompatible server responses), but some
> might not be...

There are specific dumb-http tests in t5550. And I think we can and do
run the suite with GIT_TEST_DEFAULT_HASH=sha256. But I suspect that
covers up the problem. If I understand the problem correctly, it comes
about when the client thinks the default hash is sha1, but the server is
sha256. Whereas GIT_TEST_DEFAULT_HASH affects _both_ sides.

So I think we'd want interop tests in t5550 that specifically create a
sha256 server and access it with a sha1 client (and possibly vice
versa).

It would be nice if there was a way to use an environment variable like
GIT_TEST_DEFAULT_HASH to mean "be hash X on the server, but Y on the
client". But I don't think we can easily do that. The "git init" command
which is used to create a repo that is later used for server access
doesn't _know_ that's what it's being used for. Possibly we could have
an extra variable that instructs git-clone to use a separate default
hash. And then:

  GIT_TEST_DEFAULT_HASH=sha256 \
  GIT_TEST_CLONE_DEFAULT_HASH=sha1 \
  make test

might possibly trigger some interesting cases.

-Peff

  reply	other threads:[~2021-05-11 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 10:37 [PATCH] remote-curl: fix clone on sha256 repos Eric Wong
2021-05-11 13:36 ` Junio C Hamano
2021-05-11 14:47 ` Ævar Arnfjörð Bjarmason
2021-05-11 18:25   ` Jeff King [this message]
2021-05-11 21:02     ` Junio C Hamano
2021-05-11 21:23     ` Jeff King
2021-05-11 23:04     ` brian m. carlson
2021-05-11 23:01 ` brian m. carlson
2021-05-11 23:48   ` Junio C Hamano
2021-05-11 23:51     ` brian m. carlson

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=YJrMNmH92mKrIX0N@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=e@80x24.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.