From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.172 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== 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== 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 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 ; Thu, 3 Dec 2026 10:03:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1AC98606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-ce1186c9e40so199960a12.0 for ; Thu, 03 Dec 2026 02:03:12 -0800 (PST) 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) 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) Message-ID: Date: Thu, 3 Dec 2026 15:33:09 +0530 X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/7] commit-graph: simplify linking commit graph chains To: Patrick Steinhardt Cc: Junio C Hamano , git@vger.kernel.org References: <20261120-pks-odb-pluggable-commit-graphs-v2-0-31f2341a9932@pks.im> <20261120-pks-odb-pluggable-commit-graphs-v2-2-31f2341a9932@pks.im> Content-Language: en-US From: Kaartic Sivaraam In-Reply-To: <20261120-pks-odb-pluggable-commit-graphs-v2-2-31f2341a9932@pks.im> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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