Article View: linux.kernel.git
Article #4301Re: [PATCH v2 4/7] commit-graph: expose function to validate a commit graph chain
From: Kaartic Sivaraam
Date: Thu, 03 Dec 2026 11:01
Date: Thu, 03 Dec 2026 11:01
68 lines
13380 bytes
13380 bytes
On 11/20/26 17:52, Patrick Steinhardt wrote:
> diff --git a/commit-graph.c b/commit-graph.c
> index 08a151af29a..e48d8fc0a78 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -574,6 +574,12 @@ static void validate_mixed_bloom_settings(struct commit_graph *g)
> }
> }
>
> +void commit_graph_validate_chain(struct commit_graph *g)
> +{
> + validate_mixed_generation_chain(g);
> + validate_mixed_bloom_settings(g);
> +}
> +
> int commit_graph_link_base(struct commit_graph *g,
> struct commit_graph *base)
> {
> @@ -701,8 +707,7 @@ struct commit_graph *load_commit_graph_chain_fd_st(struct object_database *odb,
> }
> }
>
> - validate_mixed_generation_chain(graph_chain);
> - validate_mixed_bloom_settings(graph_chain);
> + commit_graph_validate_chain(graph_chain);
>
> fclose(fp);
> strbuf_release(&line);
>
The change itself is straight-forward and neat.
diff --git a/commit-graph.h b/commit-graph.h
> index 8660c7fe698..dc4f6194c72 100644
> --- a/commit-graph.h
> +++ b/commit-graph.h
> @@ -134,6 +134,13 @@ struct commit_graph *load_commit_graph_chain_fd_st(struct object_database *odb,
> */
> int commit_graph_link_base(struct commit_graph *g,
> struct commit_graph *base);
> +
> +/*
> + * Validate the chain of commit graph layers to ensure that all layers are
> + * compatible with one another. This may disable generation data and Bloom
> + * filters in case they aren't.
> + */
I just wonder if we could make potentially rephrase this comment as
follows to make it more useful?
/*
* Reconcile the settings of a linked commit-graph chain, where `g` is
* its tip layer. Must be called after all layers have been linked.
*
* If any layer lacks generation data, generation data is disabled for
* all layers. Bloom filters are compared against the settings of the
* top-most layer that has them; lower layers with incompatible
* settings have their filters dropped, with a warning.
*/
> +void commit_graph_validate_chain(struct commit_graph *g);
In the same spirit, I wonder if commit_graph_reconcile_chain might be a
better name for this one?
--
Sivaraam
Technical Details
Message-ID:
<faa1ad05-b19f-4876-85a1-4060abbad13f@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76949-linux-kernel-git=dewy.ruReferences:
<20261120-pks-odb-pluggable-commit-graphs-v2-0-31f2341a9932@pks.im> <20261120-pks-odb-pluggable-commit-graphs-v2-4-31f2341a9932@pks.im>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76949-linux-kernel-git=dewy.ru
From: kaartic.sivaraam@gmail.com (Kaartic Sivaraam)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2 4/7] commit-graph: expose function to validate a commit
graph chain
Date: Thu, 3 Dec 2026 16:31:10 +0530
Organization: Usenet Network
Message-ID: <faa1ad05-b19f-4876-85a1-4060abbad13f@gmail.com>
References: <20261120-pks-odb-pluggable-commit-graphs-v2-0-31f2341a9932@pks.im>
<20261120-pks-odb-pluggable-commit-graphs-v2-4-31f2341a9932@pks.im>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2466403"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bCSkNwbq6vIht7RTW0zmFfzfcy4= sha256:OUaCVD12m3zjw/nN7NLPdGW28EQcEUoVY9rO1A9SIQw=
sha1:I/VL6Dj/PVbPdyYSfU6LhAm2eUw= sha256:t8ZasKnXMuwyYuHAMEFsh+igMqb0/PpvS7eh8A2OcRw=
Content-Language: en-US
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 DE8BD1178DD; Thu, 3 Dec 2026 14:01:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
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 (2048-bit key)
header.d=gmail.com
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 UMy13UIBgQdg;
Thu, 3 Dec 2026 14:01:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76949-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 417851178B4; Thu, 3 Dec 2026 14:01:17 +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 985E02AFEC; Thu, 3 Dec 2026 11:01:15 +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=1796295675;
b=hslzpdz5d1LvSb0Gz2SnPrvxeOhePqMZC7AdnrYW4fq9/N6MtRQscUx9istVZaJD4q5E
7f1BuKn8I2FlWyd26TJ1NGt8UelyslgJj6qRenx2xpVBX7SE9WkIHE0p06jiFEpZSSug4
dsjT94FmsQiuGhsdRcfLhRF4EkaVYh5QqQYWZMPZnvkwq9oMGi718Jhrcz+MPDUwLd8uB
aq9w7wwlf0dFnZpRSv9OmjcsGqLAvuYRy1w3jYr9AjXv7j1AEkrz+OTXdiI4u0HTiu/F8
ascHNxEZJMf85Wl6HQnkVp3KxZieK1d5UNUvirOcc/twWh1wJPbzhAcz/zvQQOYt04g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796295675;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Message-ID:Date:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:User-Agent:Subject:To:Cc:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=J+mhEjVEN+sACbnHZCYm9xrEN35CylG44v2Es+tlxNo=;
b=MEXXz2kX0TZx12caFsu8dwZqqZKtWH1RJGsA64PIU0bWsuAK5RvC4tJx37A2bEBPYkxv
tcJA2Lbfyn3sBxCVdjLy9wAYPHfOQK4j36xBgUW0FaIWESbR/jCUQZ+p1m6OvDP/Qn1lP
S948/K375Y40rnGVTVP9o7tilhN9af6sMoP2N5s9DOSnI9lPxqK23KkW0m1YDJTxuLJGt
BeLqYK2dFijdrtVzFOGD01eL/CSkfqCu5Hk1uWIdhMfLico7+FvwWE25cjO1R5g08vLXB
NM2UxuGaHTBH+pzN+SozRlMZyfZK0eA38wIDo+3qLz4u4zM0g7FIgFhU3/Hh4p4kkhQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=tf8QJMSl;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 3C586606A334;
Thu, 3 Dec 2026 11:01:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=tf8QJMSl
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796295674;
b=U6ZeAHvhEXtb0rpq6vBtAMp1e+kALX/h90b2/8gqSDTVK3uUygrl+PqZcsJLCxwI9kzK
X/m2urux3XCQKsaQutPleFz57DmT4QjHdt6qSSNVtkQEwLAqIrsph7VcDlIxjPV8XHE9Q
6IxdQ7QJKtCPaOqE8qeBYGeVxFwqqyBG74dVW5ZH8yRsD4Zv3Yeg9crzVsP2f0F9M9FaN
lK9LReOQaaKTB/IkvjrI21MbhxnYH9esRSKbLBVU+f2woQDJaDMgKuZSHRzpM0b6eP4PE
pIKncIGaTe5mfcXwPTPkXJD6RsGrKNRSMwUrN37uAZCXJ58I86OHnEbn4qz0Lq2I/Nw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796295674;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=J+mhEjVEN+sACbnHZCYm9xrEN35CylG44v2Es+tlxNo=;
b=1DZhS+i3B2r3GdnjBn8jpQn+wKS1/jxAXvfWxfnNDkCrbSjSeSUo+EXdocwfhLssLIfO
sJvGqEaTPAwlCIeGV0gK/E9FlPz2Hz2nTXxh9SbR4Sk9hUY1ixzQV3J/5ZQpFOjCMjBPS
o8/CNLZSSwRdPoYil9rQNtP6ud2WmO/MLxds4S9N2i+c5z+91XQpl5Dr8hxjpTF7eAZr/
rjoZJ4k9Gbb7T3KB5TYaRXoHWn6nnLCB/oMBm2mkDqMLqzitIAJyDxmd+as8X5f942kcf
C7sCcJAJgH/r20h0+aV3ps87DfmUDnaJl8XoCaX4F9UgX+oi/XtDAI4NpjNOql3YxDQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=tf8QJMSl;
arc=none smtp.remote-ip=209.85.215.170
X-Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04782606A322
for <git@vger.kernel.org>; Thu, 3 Dec 2026 11:01:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 04782606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cd6028ff33fso7320153a12.0
for <git@vger.kernel.org>; Thu, 03 Dec 2026 03:01:13 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796295673; x=1796900473; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=J+mhEjVEN+sACbnHZCYm9xrEN35CylG44v2Es+tlxNo=;
b=tf8QJMSlvxDM0avxEEUGs8t9t1cR7/MZM+Jw5ShTHYvIco1tk26VufayKI6OXmnmhD
TNiIWxNfT1KgPaBsht2aQEGY4YTyhQ4sm0J1TKUICq685RT8fIdQ8B8Sav+c4tV9TlFN
S/KdQzz38GJWXNapeNFUSfrJJi0FQEN6Ofxv5iFi1fAqRJJGKhL3PcEEHann0K9cUqHY
3907stXyVpPRj4c1zxQMz3TbLDSnd8E2RLPjwFYQdXMUsKVX5ABw983+tSgFZFrUKFEU
l2vVBYHotHSlzkWzSdF8Op7b5MBxImseUtOs4PMLEQnL1TsFfnySmvlgexjFPU9VB+qW
Dtsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796295673; x=1796900473;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=J+mhEjVEN+sACbnHZCYm9xrEN35CylG44v2Es+tlxNo=;
b=y7QZx3SYy7RJ0JAp47YC1UTxq4sZuI9iYZzvJlGVmAQifY5JBBtrJbLEAwCe7JDMup
83LqBMsigU9uMANW+8uyyNu7PcbwFYsZ8hYajwyOidVBRx+uu5ecbzptYOoeyorCuFD9
iE23b5EyhcBXkzrrxo4mVJYaqNmoZ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SWFB4GJjw==
X-Received: by 2002:a05:6300:8095:b0:3e1:3858:1dd0 with SMTP id adf61e73a8af0-4014c2538cdmr41527622637.42.1796295673242;
Thu, 03 Dec 2026 03:01:13 -0800 (PST)
X-Received: from [192.168.1.34] ([103.215.237.233])
by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cdebb45c972sm14995369a12.20.2026.12.03.03.01.11
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Thu, 03 Dec 2026 03:01:12 -0800 (PST)
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-User-Agent: Mozilla Thunderbird
X-Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
X-In-Reply-To: <20261120-pks-odb-pluggable-commit-graphs-v2-4-31f2341a9932@pks.im>