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

Re: [PATCH] remote-curl: fix clone on sha256 repos

From
Jeff King <peff@peff.net>
Date
May 11, 2021, 18:25 UTC
Message-ID
<YJrMNmH92mKrIX0N@coredump.intra.peff.net>
In-Reply-To
<874kf9tjgj.fsf@evledraar.gmail.com>
On Tue, May 11, 2021 at 04:47:28PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 13 quoted lines
> 
> 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
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 4 of 10 in “remote-curl: fix clone on sha256 repos”
  1. remote-curl: fix clone on sha256 reposEric Wong, May 11, 2021
  2. Junio C HamanoMay 11, 2021
  3. Ævar Arnfjörð BjarmasonMay 11, 2021
  4. Jeff KingMay 11, 2021
  5. Junio C HamanoMay 11, 2021
  6. Jeff KingMay 11, 2021
  7. brian m. carlsonMay 11, 2021
  8. brian m. carlsonMay 11, 2021
  9. Junio C HamanoMay 11, 2021
  10. brian m. carlsonMay 11, 2021

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.