All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Wong <e@80x24.org>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: [PATCH] remote-curl: fix clone on sha256 repos
Date: Tue, 11 May 2021 22:36:51 +0900	[thread overview]
Message-ID: <xmqqy2cll7d8.fsf@gitster.g> (raw)
In-Reply-To: <20210511103730.GA15003@dcvr> (Eric Wong's message of "Tue, 11 May 2021 10:37:30 +0000")

Eric Wong <e@80x24.org> writes:

> The remote-https process needs to update it's own instance of
> `the_repository' when it sees an HTTP(S) remote is using sha256.
> Without this, parse_oid_hex() fails to handle sha256 OIDs when
> it's eventually called by parse_fetch().
>
> Tested with:
>
> 	git clone https://yhbt.net/sha256test.git
> 	GIT_SMART_HTTP=0 git clone https://yhbt.net/sha256test.git
> 	(plain http:// also works)
>
> Cloning the URL via git:// required no changes

OK, so smart-http is disabled because it is just a slight variation
of the native Git protocol in disguise running over the http
transport, while the non-smart-http uses totally different codepath
to initialize the repository, and this bug does not appear when the
native Git protocol is in use?

I guess we use "git clone" over HTTP in many place in our tests, so
there is no need to add a new one to safeguard this fix from future
breakage (instead we can just run the whole test suite with SHA256)?

Will wait for brian to comment.

Thanks.

> Signed-off-by: Eric Wong <e@80x24.org>
> ---
>  remote-curl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/remote-curl.c b/remote-curl.c
> index 0290b04891..9d432c299a 100644
> --- a/remote-curl.c
> +++ b/remote-curl.c
> @@ -555,6 +555,8 @@ static void output_refs(struct ref *refs)
>  	struct ref *posn;
>  	if (options.object_format && options.hash_algo) {
>  		printf(":object-format %s\n", options.hash_algo->name);
> +		repo_set_hash_algo(the_repository,
> +				hash_algo_by_ptr(options.hash_algo));
>  	}
>  	for (posn = refs; posn; posn = posn->next) {
>  		if (posn->symref)

  reply	other threads:[~2021-05-11 13:37 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 [this message]
2021-05-11 14:47 ` Ævar Arnfjörð Bjarmason
2021-05-11 18:25   ` Jeff King
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=xmqqy2cll7d8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --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.