Article View: linux.kernel.git
Article #2646Re: [PATCH] setup: default hash algo to GIT_HASH_DEFAULT
From: "brian m. carlson"
Date: Sun, 08 Nov 2026 14:38
Date: Sun, 08 Nov 2026 14:38
65 lines
11835 bytes
11835 bytes
--HklZObr7OUXM4dwr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2026-11-08 at 04:42:56, Junio C Hamano wrote: > "brian m. carlson" <sandals@crustytoothpaste.net> writes: >=20 > > When we have no other hash algorithm to choose, we set no hash > > algorithm, which ends up with us defaulting to SHA-1. Instead, default > > to GIT_HASH_DEFAULT. This means that we will choose SHA-256 in breaking > > changes mode and in Git 3.0, which is what we want. > > > > Reported-by: Adam Dinwoodie <adam@dinwoodie.org> > > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> > > --- > > setup.c | 2 ++ > > t/t0001-init.sh | 16 ++++++++++++++++ > > 2 files changed, 18 insertions(+) >=20 > With Git 3.0, we promised that SHA-1/SHA-256 interop will not have > to be ready, and that SHA-256 would become the default. And this > patch would be a good thing to have for the second promise. >=20 > But didn't we also discuss "empty/initial repository whose hash > algorithm is undecided can take a push of either SHA-1 or SHA-256 > payload and that first push can decide and freeze the hash algorithm > used in the repository" or something along that line? We discussed that as a possibility, but it requires protocol changes and nobody has stepped up to implement that. I think Peff was thinking about maybe implementing that, but I don't think anyone came to a decision. > I am wondering if we want to reserve 'HASH_UNKNOWN' for such a "was > just created, not quite finished initializing yet" state. I think we concluded that we'd need to initialize a repository to _some_ hash algorithm even if we had the limbo state because otherwise people could `git init` and then work locally and we need to have some existing hash algorithm for that case. That would be true even with bare repositories. So I think the limbo functionality, if we implemented it, would be a separate option (maybe `extensions.potentialObjectFormat`?) and this patch should go in either way. --=20 brian m. carlson (they/them) Toronto, Ontario, CA Speaking for myself only --HklZObr7OUXM4dwr Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- wr0EABYKAG8FgmrwiWwJEHwMSWKIh6KBRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z LnNlcXVvaWEtcGdwLm9yZ3QhWGgE8/MweIJYSRWEgjkmGv1EzF0/A89QFobSFoc/ FiEECCzmip28ZfuD0cORfAxJYoiHooEAAN9zAP40gpRmFO710rgI/HViVC7jCr3n +Z8qNYWMlqLyKsIIzAD/aHb1BydUWK3jiZUvmfaKrkg0GEHIWAnV5zE0bejvHgw= =MehV -----END PGP SIGNATURE----- --HklZObr7OUXM4dwr--
Technical Details
Message-ID:
<avCJbJE7mx_Z2zLY@fruit.crustytoothpaste.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74831-linux-kernel-git=dewy.ruReferences:
<CA+kUOampvjU3=VK3VGhYw2L5-E+LBsk=Q0UrAxhhR7hC5SUdJg@mail.gmail.com> <20261108011633.1772000-1-sandals@crustytoothpaste.net> <xmqqtsls53xr.fsf@gitster.g>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74831-linux-kernel-git=dewy.ru
From: sandals@crustytoothpaste.net ("brian m. carlson")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] setup: default hash algo to GIT_HASH_DEFAULT
Date: Sun, 8 Nov 2026 14:38:37 +0000
Organization: Usenet Network
Message-ID: <avCJbJE7mx_Z2zLY@fruit.crustytoothpaste.net>
References: <CA+kUOampvjU3=VK3VGhYw2L5-E+LBsk=Q0UrAxhhR7hC5SUdJg@mail.gmail.com>
<20261108011633.1772000-1-sandals@crustytoothpaste.net>
<xmqqtsls53xr.fsf@gitster.g>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="HklZObr7OUXM4dwr"
Injection-Info: usenet.network;
logging-data="143010"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pNMDcN4Zv9hL0oc/LxgH5QB6+/g= sha256:r6+6WAkPSp23xiJdeiXR/eCcgjUhJ30TJQ+hL4ahqkQ=
sha1:xwtZ5OD+XfzjpxzFuRKb/vBdD7A= sha256:S+B5Y3ErqMMjpBxlwDU0fEFK5ZhkkzZUsQHggonLqrM=
Content-Disposition: inline
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 7F2BF1135AB; Sun, 8 Nov 2026 17:40:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (3072-bit key)
header.d=crustytoothpaste.net
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id IcYZydD6QK04;
Sun, 8 Nov 2026 17:39:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-74831-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=crustytoothpaste.net
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 3C72B113578; Sun, 8 Nov 2026 17:39:49 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 9471528A2A; Sun, 8 Nov 2026 14:38:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794148722;
b=sYQLWaQDB+8B4WGuIj48HnDTQYS9q52EvdNIv8GAqR9OnaO8JLZKtMNuTfyAnQRTD/y1
V3xWqSJSgWGp50s1Y5brxWNaWPcKL5hhxZVmCNbZWpgk0ItWN0YvZFm7JwsE11td7Ttcw
N4Yodo/sWjxvv697CrUr8lOu/K5ckhXGtxnuWBQZinx/spdBPehvtMO/z7fcpeSrh7Evr
elj+AtxP8Kcfr0eVZLzIHNQYWCqLMnAfFSNAov4OEdU3tO65/g2QVe3PkwhhNAA0EADN/
aY88naSkchGHs38khMXyxZC2mhybjTNUgJn611b/M2aoCt6m9P4wj8skahSk8fYTUVg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794148722;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To:User-Agent;
bh=EsAtUe2cguol8bynsGkz066PKf2xpm83v9yMHvOWFy4=;
b=QvvjCW5xt73q0IAxfCP3bw4qT1OXAOGzDctxB817CU1WLc1JCPpZPMrOiHmBs8US3JwW
q4vavrjpMcKIbdjVGY0s5vMzKwQn5nD+yMrHD//C8aILGcZlLOeo6YufZQWt4F1vFyex4
S71uYy7z2xYuKxf5+RdyjVPv17fP3xpJuy0eOIdUoD2MQ2gVCmJ/4VeGWqQyIHyY7cy6q
obnD+yyim7n8hO+weiuKCalNW6l8EW0es1nMLPujNq5AxMobMz8vLgBrcdbDERvKdixnN
mei2mmPwKtxjLOfvnrNbw8/Jy1sh3q2kODPEkSe9KGgfujCCYAFiei+MoBFPVWfcwSg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=uxOgjm4x;
dmarc=none header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 33E5D606A330;
Sun, 8 Nov 2026 14:38:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=uxOgjm4x
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=172.105.7.114
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794148721;
b=a7Sfj0QM/k2eelNesHx4rKO+IvBdNFlo0fLPb99ZVVmJs3dOtSXKZ8JmrMF2D71mXqK2
l0ZOWRBsjn1tymN4mb5jfs9DQBhbSsZqREghloIe6xPImaxxRmQYDjklIH8JOFaavfyjK
xxVb4HoP6jgEZRmQCpK1GHtyO7m87T1SqEEWq1aSohJgeUDotHejLUS76EcAUoqo1Cx5q
FcG3XLKNw+Fnhb4IQ+LmLSrX0jHm1xZFJAXenKDC0N2Wqbf0BQL1e6nRfNhFrbDXB500a
pm2gtyqNUQ5XWlAabLzMDLS+vrIVs8yBkNjYv1k4+FA7E1v6h8xACNxw7G+84P3ZWgw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794148721;
h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To:User-Agent;
bh=EsAtUe2cguol8bynsGkz066PKf2xpm83v9yMHvOWFy4=;
b=3uylV+AXZsGXIXG+ULmCwV8aJMRRXfl1N5PnbLSeZKr2+VY/D4xQ3JYxt5RjMk2EBU9r
eLhezXJdbdSUY+YntPwPTd2issXnkBFXFx3ZwXBWHJxtKW4KpRqLakVE36qVg17TSB3iT
6Varqj7xyO/apSFAIvT5fLVKz5xPIgF7LllMefIXFmIhqwTKOft80FpaceHDb/9DOXKeK
BhtNxNeHEctPRHmK3g7TY5/YtB+5lCkndlK9XGik/BXp8zpsEDRy6pyLeDWSLO5Min0vo
+I8oUgfolbbmZQWagujeW8vi7pZiTLSspYcHpnBnNCCbydJUcGasR4inm4Ej6yjpCIg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=uxOgjm4x;
arc=none smtp.remote-ip=172.105.7.114
X-Received: from complex.crustytoothpaste.net (complex.crustytoothpaste.net [172.105.7.114])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57C0A606A31C
for <git@vger.kernel.org>; Sun, 8 Nov 2026 14:38:39 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 57C0A606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=crustytoothpaste.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crustytoothpaste.net
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net;
s=default; t=1794148718;
bh=1FRUDU4d57D1V9UmqsYF072dgwrKGqaLs/x4jys+DHs=;
h=Date:From:To:Cc:Subject:References:Content-Type:
Content-Disposition:In-Reply-To:From:Reply-To:Subject:Date:To:CC:
Resent-Date:Resent-From:Resent-To:Resent-Cc:In-Reply-To:References:
Content-Type:Content-Disposition;
b=uxOgjm4xrTQwaX4scmptSP6WIYxaaFZNSIGy2N4KY2ei1lYAPfu5Voyy76R/oMuLP
iYtJODQcq+7Zgzb0ve2wPuVnp+5QUwbUDSTpoFerEtxKiq6FsSOgp0fv0BG3C6JNsN
eZBa1KZN1YlboHJC7q13tFFpBMn+8dK1yP7ADaeyfhenx/209CdR2KphFcxwoCLJfY
FTMiXtpI7EFO8JYxJfeNbiRvlJCIjc7+mwz+julJ5tRJ4pdMs6h6CZaycUXNFYI1ZC
zJp0L8E2wwQqQfU0A3aEaAkYVTgabVIaqs6Tbt13P0HHkZCe1JFjpbM53EG/I1XWFX
LwoOphGkjZbIkOgBBT0ox3Tx05jj4qrUjh1e0E0kAjMOHRSr4Oad3XSe/hNEshf147
7LDil16NsPV44aEgG1f0tos3bhVEcGwl7uTLD5iW2etadb5XREeck2cZvo0t6mKUnU
KPKtH+G4antGp9npNp15slBD5yeQc5WWhZDRTL1QpodqzGvNt79
X-Received: from fruit.crustytoothpaste.net (unknown [IPv6:2607:f2c0:f00f:f901:ba43:21ec:77f4:1818])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by complex.crustytoothpaste.net (Postfix) with ESMTPSA id BDDB0200AA;
Sun, 8 Nov 2026 14:38:38 +0000 (UTC)
X-Cc: git@vger.kernel.org, Adam Dinwoodie <adam@dinwoodie.org>,
Jeff King <peff@peff.net>
X-Mail-Followup-To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org,
Adam Dinwoodie <adam@dinwoodie.org>, Jeff King <peff@peff.net>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <xmqqtsls53xr.fsf@gitster.g>
X-User-Agent: Mutt/2.4.1 (2026-07-04)