public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Cc: joliss42@gmail.com, git@vger.kernel.org, Jo Liss <joliss@gmail.com>
Subject: Re: [PATCH] remote-curl: set fallback hash algorithm outside repo
Date: Sat, 21 Mar 2026 23:09:16 +0000	[thread overview]
Message-ID: <ab8lHBDvjTjatE9s@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <20260321194653.24513-1-jayatheerthkulkarni2005@gmail.com>

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

On 2026-03-21 at 19:46:53, K Jayatheerth wrote:
> diff --git a/remote-curl.c b/remote-curl.c
> index 92e40bb682..4c85e6b079 100644
> --- a/remote-curl.c
> +++ b/remote-curl.c
> @@ -1547,6 +1547,10 @@ int cmd_main(int argc, const char **argv)
>  	int ret = 1;
>  
>  	setup_git_directory_gently(&nongit);
> +
> +	if (nongit && !the_repository->hash_algo)
> +		repo_set_hash_algo(the_repository, GIT_HASH_SHA1);

This should be GIT_HASH_DEFAULT, which is whatever the default hash is.

GIT_HASH_SHA1_LEGACY is for places where we assume SHA-1 because the
data format doesn't specify (e.g., v1 bundles) and GIT_HASH_SHA1 says,
“The user or data format specifically chose SHA-1.”  The user didn't
specify any particular algorithm here (which is the problem), so we
should go with the default (which will change to SHA-256 in 3.0).

That being said, I also agree with Peff downthread that it might be
better to fix this elsewhere,
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

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

  reply	other threads:[~2026-03-21 23:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 19:11 remote-curl: segfault parsing remote.<name>.fetch outside a repository Jo Liss
2026-03-21 19:46 ` [PATCH] remote-curl: set fallback hash algorithm outside repo K Jayatheerth
2026-03-21 23:09   ` brian m. carlson [this message]
2026-03-22  2:35   ` [PATCH v2] refspec: safely parse refspecs outside a repository K Jayatheerth
2026-03-22  3:31     ` Junio C Hamano
2026-03-22  3:53     ` Jeff King
2026-03-22  5:36     ` [PATCH v3 1/2] " K Jayatheerth
2026-03-22  5:36       ` [PATCH v3 2/2] refspec: fix typo in comment K Jayatheerth
2026-03-23 22:27       ` [PATCH v3 1/2] refspec: safely parse refspecs outside a repository Junio C Hamano
2026-03-23 23:10         ` Jeff King
2026-03-23 23:39           ` Junio C Hamano
2026-03-24  1:57     ` [PATCH v4 1/2] remote-curl: fall back to default hash outside repo K Jayatheerth
2026-03-24  1:57       ` [PATCH v4 2/2] refspec: fix typo in comment K Jayatheerth
2026-03-24  4:25       ` [PATCH v4 1/2] remote-curl: fall back to default hash outside repo Junio C Hamano
2026-03-21 21:06 ` remote-curl: segfault parsing remote.<name>.fetch outside a repository Jeff King
2026-03-22  1:20   ` Junio C Hamano
2026-03-22  1:37     ` Jeff King

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=ab8lHBDvjTjatE9s@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=jayatheerthkulkarni2005@gmail.com \
    --cc=joliss42@gmail.com \
    --cc=joliss@gmail.com \
    /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