Article View: linux.kernel.git
Article #3946Re: [PATCH v2 07/13] builtin: populate pack index v3 fields when indexing
From: "brian m. carlson"
Date: Thu, 26 Nov 2026 22:27
Date: Thu, 26 Nov 2026 22:27
60 lines
12065 bytes
12065 bytes
--+JDPK2lUW+uF/RkK
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On 2026-11-26 at 21:47:38, Junio C Hamano wrote:
> Christian Couder <christian.couder@gmail.com> writes:
> > @@ -483,8 +493,15 @@ static void *unpack_entry_data(off_t offset, size_=
t size,
> > hdrlen =3D format_object_header(hdr, sizeof(hdr), type, size);
> > git_hash_init(&c, the_hash_algo);
> > git_hash_update(&c, hdr, hdrlen);
> > - } else
> > + if (compat && compat_oid) {
> > + git_hash_init(&c_compat, compat);
>=20
> Doesn't this regress indexing using v2, though?
>=20
> Here in unpack_entry_data() (called with &obj->idx.compat_oid from
> parse_pack_objects()), and similarly in resolve_delta() when checking
> 'if (the_repository->compat_hash_algo)', the conversion runs even when
> opts.version < 3. Because index-pack cannot yet convert commits or
> trees whose referenced objects appear later in the pack, running an
> ordinary 'git index-pack' writing a v2 index in a compat repository will
> now fail on packs that previously succeeded, even though '.compat_oid'
> is discarded for v2. Gating compat calculation on 'opts.version >=3D 3'
> (for example, passing NULL for compat_oid from parse_pack_objects() when
> opts.version < 3, and checking opts.version >=3D 3 in resolve_delta())
> would avoid regressing v2 indexing.
You can't use index v2 (or v1) in a repository with compatibility object
IDs. The reason is that we need the mapping preserved and v1 and v2
don't do that, so they lose data. If we use v2 to index a pack that's
already been indexed or a pack that's the result of repacking one or
more packs and we have a compatibility algorithm, we've lost the mapping
and a large number of operations will simply die loudly since the
repository is effectively corrupt in that case.
I believe a later patch in the series will force v3 when there's a
compatibility algorithm in use. This is much like SHA-256 bundles
always use bundle v3 since v2 can't express the hash algorithm in use.
--=20
brian m. carlson (they/them)
Toronto, Ontario, CA
Speaking for myself only
--+JDPK2lUW+uF/RkK
Content-Type: application/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
wr0EABYKAG8FgmsIsmMJEHwMSWKIh6KBRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z
LnNlcXVvaWEtcGdwLm9yZxkWvUL0lxBPlU3qFDbpqRiBdKV7283UEpgMd2f3I/CG
FiEECCzmip28ZfuD0cORfAxJYoiHooEAAK2IAPsGhJo0TIb2b1d+YNyU2bBIS2eE
dFwqmsWoagPAlHZjtQEA1hmRVK+z2Ax4YF++0DJMNwD/UlRQ4CctXvfpdgTVJwg=
=33uG
-----END PGP SIGNATURE-----
--+JDPK2lUW+uF/RkK--
Technical Details
Message-ID:
<awiyY0v5pUnWm-Gd@fruit.crustytoothpaste.net>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76492-linux-kernel-git=dewy.ruReferences:
<20261023072559.3204273-1-christian.couder@gmail.com> <20261023072559.3204273-8-christian.couder@gmail.com> <xmqq1p87i7t1.fsf@gitster.g>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76492-linux-kernel-git=dewy.ru
From: sandals@crustytoothpaste.net ("brian m. carlson")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2 07/13] builtin: populate pack index v3 fields when
indexing
Date: Thu, 26 Nov 2026 22:27:47 +0000
Organization: Usenet Network
Message-ID: <awiyY0v5pUnWm-Gd@fruit.crustytoothpaste.net>
References: <20261023072559.3204273-1-christian.couder@gmail.com>
<20261023072559.3204273-8-christian.couder@gmail.com>
<xmqq1p87i7t1.fsf@gitster.g>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="+JDPK2lUW+uF/RkK"
Injection-Info: usenet.network;
logging-data="582639"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:t26jG9Vo7CPuHuONPRt5zT8aQug= sha256:qJLBsZqFRnwqwT36v+Ky6PBE4UOtU++7BhPpAw7joLY=
sha1:vrhAeLK0cvXVyoSDNIihVxWSY2g= sha256:9t7S/zLixifstjSeCzXZIpycOu2cJR7eiT/0pTNIqj4=
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 89A69125F04; Fri, 27 Nov 2026 01:28:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.951
X-Spam-Status: No, score=-1.951 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, 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]
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 16SHytKTX60h;
Fri, 27 Nov 2026 01:28:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76492-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (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 14267125F0E; Fri, 27 Nov 2026 01:27:54 +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 5958733A88; Thu, 26 Nov 2026 22:27:52 +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=1795732071;
b=gw295CAsWGZRiStRA2cybpiWqVdDOm5buf4ZQOOCzt2A3Jcn76iUQttzWQY3bsXQkN5w
pc1+GEAun4mtZ3E3yhL7PA/wurrxyiGltjbCN049BQO+4Hpor9cq8Mr0zJoJRYUFZGytI
KqD1iwm/IlVBUR7+flQfboYd162/GJGeFbk6CooWSOs2LuBUiMxEdsLOXQBZrHCt7xWQp
DOAj+ocSZhk8+cBgPXuev0RmJZCKQ3rKeJ2ySQV0wZy9/EYC3ISqIuMKBKVm76RQ2zGtp
/8ZjjUHOxpOGQiSWoZduLFWEBDl0aE1QE07w5M/EvgkZIFt7xW9vP9+XRikerAkmBwA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795732071;
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=a1bb35Nt+4SKng8oyu+GDVZQcDpijRSK5jYRjNR2cmA=;
b=0Emm2/5u3i9vE7kv2YgUVN8EOEthm9/JnZJlQtfPQFus8U7XLG0+HSFTs9TzbuoUf+yt
p9PA75aG+PvPjeqRskAPzcWyoRZC59MNg0Vi1eEJyJfDXwG9tKva5hYG+XJszLC6Nfk/k
Qi8U05ISLu9x2vf+z0stXEOGdyHvEOczFCo5I0l4cxz44vqRuKdKnu9bzHFdjB5GF+7mV
GwcLQzqbVI8iK0QdJbN92f4/Hs5ilq9vOk1Ybd3si9W9HilNV3Nt1TNs24bjWQA0ZLC45
afjJ+78EiAhzEVvykhMPVF4hHkkPq0BHmJEbf8kN1FE4erXwk3FSQLQVsYiZeQA4rFw==
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=fBC86A8v;
dmarc=pass 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 A3355606A327;
Thu, 26 Nov 2026 22:27:51 +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=fBC86A8v
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=1795732070;
b=adux9zYsu/+MIFEbTSR6ga6s5xO/u5bsIUScNGe0kRjJiYe2dPWPk6+BO27AI1LwQkiN
faduIqmhitAqG08pUtbs/wXqRGHTLqnwIeQGT8P9ND7i3lC3KQPE7X8OfiqEk9buMZs5r
e//FvumcPeraEBuTr4B+7qrDeMvClSKy7FCMIoKfetb3JrX0iS2J3JGKyoWKlcTftPPCG
ArAvdqYcHvsMz/eEksM0UCkCo+kjDc9KUzpebXxH1w8y/8g4awluoXSkryvOOEOrCrMf1
fiMZQiY/uffTODGgOmZeCZSGnOVMlr+b6cBRCePsPZ5P3wNoLwSfjAOGipdqU+Mue2w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795732070;
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=a1bb35Nt+4SKng8oyu+GDVZQcDpijRSK5jYRjNR2cmA=;
b=5qfIT2iE3V3bUYKu+aUGPXKPM/z97C+GMqRBb6+aqjM5PZ99K8pE401Wqmcu74ynSoyL
q1RI6qo3P47D6KUChIYaK9nw1FQp/1jHHbAE2FJJXmOV8I0220XqJy9lc5uMw/hxstu3H
D9ByvhrOXqEGPIuc21DWFUtMJ7m+9VaZSM4VCJK5b/S2pT7aMjqq4Y6QUCM0D8KBQs/e6
Xd/ZYItH/hsldbwCXjhoq5SB/F2EwKqN1UDus6e7Mf7WsmshOFlrxW76NuLHTyLIlVC50
Ha/dRlkn45pMm8j4IPm0oj6+7M7HjXgv/4DvpFckUxPWmGdRXkX/JT4pUjEZTcmfnxA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass 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=fBC86A8v;
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))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40EB2606A31C
for <git@vger.kernel.org>; Thu, 26 Nov 2026 22:27:50 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 40EB2606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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=1795732069;
bh=TWagn8bRKC5/ZrAlJXaNNBqJycTXhRQFxZjFQjtUJ18=;
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=fBC86A8vWcGdPM1Vw8cAJK9dI3XTbpfpZiXlLgP9jz1mUlpwMUVMbd080g611ZocS
5ezg8yszkyn9CsYwbZYS++nfkrzjr4G51z1NgpmJ/xyYYToBdmDOsrM70Dk5XNkC6l
EnEKgqgyUiRbiNNS4XFUlAu+An/hkjRmquTYxiysr9vq4AO1WTF96+3aVBkkmlzYLY
jkulYqhGSizLYTFzzDLCosjDYpgbi9y0kfoGIBD2PBUtazeywOojKK338VlGOkcmjv
rul1bAs3+S0GtSc1YTfr65o4+aIEG+0OVKVnPAEwXvotHDKLtTffBspdFv+qO16GIr
yOIKyNtCBxK///vfeBiJ4orL/jObQvdjLs0mnoPecqO0haIcHrjy1+RWsBViE9omLs
43fmss+F0uB4jWFYs1sh/J0Ab07AozGFGcUNx9Z0DalnyFFhBpBRohLyy11Qgv56d2
thtOrcTHh9k/upj0C6LYL0FgCXNIqcZCrSlApsXkTpCiA9N8fbU
X-Received: from fruit.crustytoothpaste.net (unknown [IPv6:2607:f2c0:f00f:f901:3039:9617:3790:4535])
(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 EDE60200B1;
Thu, 26 Nov 2026 22:27:48 +0000 (UTC)
X-Cc: Christian Couder <christian.couder@gmail.com>, git@vger.kernel.org,
Patrick Steinhardt <ps@pks.im>, Elijah Newren <newren@gmail.com>,
Jeff King <peff@peff.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
X-Mail-Followup-To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Junio C Hamano <gitster@pobox.com>,
Christian Couder <christian.couder@gmail.com>, git@vger.kernel.org,
Patrick Steinhardt <ps@pks.im>, Elijah Newren <newren@gmail.com>,
Jeff King <peff@peff.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
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: <xmqq1p87i7t1.fsf@gitster.g>
X-User-Agent: Mutt/2.4.1 (2026-07-04)