🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4299

Re: [PATCH v2 2/7] commit-graph: simplify linking commit graph chains

#4299
From: Kaartic Sivaraam
Date: Thu, 03 Dec 2026 10:03
41 lines
12991 bytes
On 11/20/26 17:52, Patrick Steinhardt wrote:
> When we load a commit graph chain we verify for every layer that the
> hash of the base commit graph matches what the current tip has in its
> base graphs chunk. To do so we pass both the chain itself as well as the
> array of object IDs that we have read from the commit-graph chain file
> to `add_graph_to_chain()`.
> 
> But the array of object IDs is redundant information: we have already
> loaded and linked the base layers, and as part of that we have stored
> their respective hashes in the structure itself. Consequently, we can
> already derive the hashes by walking the chain of base layers.
> 
The hashes stored in the structure are the layers' trailers, not the 
hashes from the chain file. They only agree because the previous patch 
now compares each layer's trailer with the chain file right after 
loading it. Since this function becomes public so that the backend can 
call it, could the comment in the header  say that it validates `g` 
against the trailers of `base`, and that callers are expected to have 
verified those against the chain file themselves?

> Refactor the function to only take the new tip and base layers as input
> and derive all the other information ad-hoc and make the function
> public. This prepares for a subsequent commit, where we are about to
> move the logic that creates commit graph chains into the object database
> backend.
> 
> While at it, align on error semantics so that we return 0 on success, or
> a negative error code otherwise.
> 
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>   commit-graph.c | 50 ++++++++++++++++++++++++++------------------------
>   commit-graph.h |  8 ++++++++
>   2 files changed, 34 insertions(+), 24 deletions(-)
> 

Otherwise, the change itself looks fine to me given the changes in 1/7.

-- 
Sivaraam
Technical Details
Message-ID: <a8ec3052-16fa-431c-a3b4-bfcf9f70e575@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!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76946-linux-kernel-git=dewy.ru
References: <20261120-pks-odb-pluggable-commit-graphs-v2-0-31f2341a9932@pks.im> <20261120-pks-odb-pluggable-commit-graphs-v2-2-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!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76946-linux-kernel-git=dewy.ru
From: kaartic.sivaraam@gmail.com (Kaartic Sivaraam)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2 2/7] commit-graph: simplify linking commit graph chains
Date: Thu, 3 Dec 2026 15:33:09 +0530
Organization: Usenet Network
Message-ID: <a8ec3052-16fa-431c-a3b4-bfcf9f70e575@gmail.com>
References: <20261120-pks-odb-pluggable-commit-graphs-v2-0-31f2341a9932@pks.im>
 <20261120-pks-odb-pluggable-commit-graphs-v2-2-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="2455173"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:l11wuMHP3EP2IjjOuX+XtPpNMm4= sha256:js1kwm/CFQEB97svF5viWXAfQp2e88DA/EblxL4lUcA=
	sha1:i+vxW0E+AOetej4z+pZgoCBJrzA= sha256:KF+w/Cdn2KT6QBkWuiZGwj/0ecuZhdKsB/fC2IEHk+g=
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 CA4791178C1; Thu,  3 Dec 2026 13:03:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.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 (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 cIMxyV9kqBme;
	Thu,  3 Dec 2026 13:03:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-76946-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 826CA1178BE; Thu,  3 Dec 2026 13:03:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 5533E2508D; Thu,  3 Dec 2026 10:03:16 +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=1796292194;
	b=Mj+bNs4I4m1NENKDj73/O94eddwLU9N2wx1xSlW9X+aUbbFCpm0/sfcmdnulQkV47JdL
	 j5lRY6aI0WIFh4hrokt+w/Lw9eaTJ1YrVfLTk5QPFccRTCznVe5lcpnm81RpjUgItZPIY
	 /ouxtj6sDvSs4Xm08ii1BWcTNED+Isbd2wvo2Yq/dgxGF+IcuIth4SGxB4Z5Ez5dh9E3e
	 LnY77xmQFZCEegFuQWrSDlLfkwdh/1fg4Ctw0ziTwnf3Wwh4XgNgNUzo1VENuwDvi2CSp
	 4J9vakpze97vQC5UhCxW8QhBMXXsBg7eQGqV/eCn4jltegHOQo/RQVIbwFmjlnxXUgA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796292194;
	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=/zYToZMqL/9Ly+n9EYfA5E6WOrTzakhnmb5gdMEmT50=;
	b=FmkIzzFgOl2h9Nz5t7KuXyQKXjps6gCGJutjOrWHR8Pty8HR9RtfFUvrIfZfgQDAXR5h
	 wnd47pxx08LyT2FulDLMV8nuMz5aOooNy18H4QcHeH0VtZk0DP8Q7Ubg6ECYBQRwMrJiu
	 gar482U4RKirRtQC+1CBKO2sgp/Y1fnTfY2rBENFINfZ2SVJm1YWKInpCVwNtcAFpYFZJ
	 sNRL7GiEe3GC8gzvh9Bm0DqC8QglmG8sBKodg5Bj2dQ3ig00XhBnbiwftBy2IoOyjV0kr
	 LTgpnRK1+j/92/Kj5umAjDdwmbbl8Rw6V+2pXrUxLnqUBKCe/Q+L37qamwFbs2Sflvw==
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=Y3DHIAqr;
	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 4CC37606A334;
	Thu,  3 Dec 2026 10:03:14 +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=Y3DHIAqr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.172
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796292193;
	b=EAFe6DkYnlRKo8esm0Ftc994gFtE2YxGXdifmH+wYH4lfaUQBVQpoxNk2gOM9Brq64Ge
	 EtMZ9UTzWtdap4nYeldtkVDbBfz+Kx7rZtWenlFiwfN8FL2k2SekYkHVNVcp07fg/ZFUr
	 eWoPvn4YVAGtP4XjruxJFW5sbxM/IVfVJUVDpiPu4WpQ8fxhQJr5UcE0SS6fInpk1eEMv
	 xPU6lLRF0baeUWVPxPnnu5Vms8Od9Ua3zPQQBXZ03+XoqYIoTRXO+JJ+R+FPy8SHZKHn7
	 kG9n2UDlR8FTDzKIog99kbwI9vgRqSWJ0nnA314zL7t5B5izgbPN4O9s6REh1piHx8Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796292193;
	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=/zYToZMqL/9Ly+n9EYfA5E6WOrTzakhnmb5gdMEmT50=;
	b=YfqZyB5qB5pV+6+RDe/ncd+t6o0NDYqFHIUrXbreiMdAka7ksEb+AeS2KlE3mNOrupbI
	 eebNuQIddnRI7/AgVX3oDny712pVoZvPCeg60dyINn4DWXhGWuJgJ39YmdcNxaWuXpGo/
	 Scbi5WSjp9wpG5KsRPdll8mX9u1pQlomJldI7BqNSp2geXn1+vqavKpaFEHDLLJKoROos
	 B1rpoguSOazAsmbMQhXJ2HxJ/eR8IOuK+vpNppPnZFmjhkPWbd6kpmjHREk/YLqF2uM7x
	 7mCk++rzz2V4H+72ySLYTDI0/+fjr/xB2pZ8+o+blybFGi1O6EYSO+uBewWDcmFxIkg==
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=Y3DHIAqr;
	arc=none smtp.remote-ip=209.85.215.172
X-Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172])
	(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 1AC98606A32D
	for <git@vger.kernel.org>; Thu,  3 Dec 2026 10:03:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1AC98606A32D
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-f172.google.com with SMTP id 41be03b00d2f7-ce1186c9e40so199960a12.0
        for <git@vger.kernel.org>; Thu, 03 Dec 2026 02:03:12 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796292192; x=1796896992; 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=/zYToZMqL/9Ly+n9EYfA5E6WOrTzakhnmb5gdMEmT50=;
        b=Y3DHIAqrugO93LZagx72YvW+IV4NVW4O1GgVrr618/LnM/MnJTi8CXB/+D0R8VnlcG
         HpmFhMst2fqbwwiXr1AVwOqPsRokNmhR/oZK6FKwe9zDM248Meiby1aZKsFV9gfkQphF
         Phi+Eiv7lvsPVH3LFegd4VIpTAcktQLHOwuN9yn6jljMYqnCO4Q2PIjOMZKgiNnP9+xB
         /VauNLUm/Vl4yY8DI2nbcY0wMNtGRczPoBdtRQ8FPy+YzJZzvGqT0HOKNtVVY4OIsIxy
         K4HbJMQZE706eHqfN0Oq/qN0taZsVbjvPSBTA17jgznOPUmsqhNFEU6LH7DbEMnDnPB6
         j0qA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796292192; x=1796896992;
        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=/zYToZMqL/9Ly+n9EYfA5E6WOrTzakhnmb5gdMEmT50=;
        b=V89l+XR+BcMRE085lUdp2OYNheaaEi0PY/83PCxbwM/lgjQgsMhC1FKqIGsFhSONZD
         le8frowDeGNED8qcIYQwrZD1WHgtdf8dOmsIuKXQym+5ok4iJ/GtbeUNOWfzlx0KFHa1
         zOzAIFzFJLLTU7wa1vgtM5csVpUh+iOUvm++5VfiFpnk1rCXHbDvQPSAG6d1gk4qBlG7
         Xg9qa8v6+yVwm7j3zrrZ2YbEtqR47ogq+o3JkihZ2ndKo5ckOBv/mzoXkcUeE/9kzm7L
         2zPD9He5E2viOgnsdUr+bRbLRxcgWLLuBh4FSyU4P+8lle8uDQQZJ1dEeBYA7Fv0fCVF
         ESoQ==
X-Forwarded-Encrypted: i=1; AL+hErGVJD6lwVJ4fNczYXKppXvmxXec/dmhIhIkVjeSx2cay/JCeWxF6GFgyW91U7i+Q3eHIx8=@vger.kernel.org
X-Gm-Message-State: APuU4Z/2dAazkEG6ZaoY+cqqD7vGFN0ZsO2o4q2+I43Qw1gb05L/Nq4h
	1Vh3UCmVA+4z940fRuufkAHgxO6ojQiOegbA6lDi0WvYimm8m6uT3Vz+
X-Gm-Gg: AZFdTZdEu6WN9bqb29pkIcxSLeJ/tNFIinFschhS9TH4JwlcZcaA2qgCzZRgjRFj4x1
	LflLU1PAgjR/TjTjf4nCdspuZK04XIGU8LdvOo/YH8+cYiB52PnbVV3ft78GzhWZdy+tEjSuh0Z
	j/Rp9m/LaSo/yUOErpgDxn8Q4Fu9WDTW1gNFT+qCixJ8ytXsO7Ad3utQdx9t0CQhL5Yk8vMjkEP
	MYfV816vWS/dzexCPk1XIB2rGAADkcczfZiNHS6tn20eVvmOxvMnXiH/69nhvx8ekhCBqzZcifC
	IF/J1U5M8Lm+FRXin9nHMy9yGpCN25LCz315WhgXHF9Eq7cY1C/tGdPgxgUcSTS6n1Pb3IMK8VV
	yXfd10K3D1QtxPg7fh0YifeNjLKp6O3xJdHUvHMVF0X8XbD+FkAw8NwwixmnLPbnzRIb80GtczX
	phW2KReFpgKylY6QlXtc1VBmxuMd5+BGKS13w4G7NNH0SV0fAU/rRVDceTzcDR5svGpr+i/Addx
	ZVs0Zwyt/PPimu3DbBLNE9Fec/5UIS6niwJMxks+TqEZiEJXFeq2saevRCzZ7npKykEGURRdl9x
	IIrpB0yWGUhw7zBWD3oxXBnCVkr378BJb49BeVrSzw==
X-Received: by 2002:a17:90b:4c0b:b0:3b4:12a9:2e1 with SMTP id 98e67ed59e1d1-3b41c931d36mr44961803a91.33.1796292192094;
        Thu, 03 Dec 2026 02:03:12 -0800 (PST)
X-Received: from [192.168.1.34] ([103.215.237.233])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c764a033sm3709052a91.1.2026.12.03.02.03.10
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Thu, 03 Dec 2026 02:03:11 -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-2-31f2341a9932@pks.im>