From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.170 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== 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== 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 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 ; Thu, 3 Dec 2026 11:01:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 04782606A322 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=tf8QJMSl Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cd6028ff33fso7320153a12.0 for ; Thu, 03 Dec 2026 03:01:13 -0800 (PST) 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 iE23b5EyhcBXkzrrxo4mVJYaqNmoZK79rVUH9f+EXfGmwtiDy+9wnVCQ6MYhHOcjliBK Sz2CcM+bQ1eI/GxdirundHKc6qVYhkYjL+j4RHmNgPfuKQn9F6nii7heG5RfdU042PnT HM+3iVa/T8XsT16U/5ceHesfhNsmEnK6IY4n1pFZsl+LLXjJKtu+mc9aW+UzoTsqh4f5 DN0A== X-Forwarded-Encrypted: i=1; AL+hErFcKP9fXoATLeWM3jC0XooIx2Ljg73MGryJFuTl4LvghCf+Tk2rqouimBfWdXyVEtpYPrQ=@vger.kernel.org X-Gm-Message-State: APuU4Z/Oia8kkfvuwMHAyAG/rDDbD2Kq1cVZf12hrY+7R27ZZbF1rQf2 tHUqsuCvT6/pvAGTsUxK2bYVwTcAuQj+IrwDNWqgk+yylxeAYlNv2mS19ktR/Q== X-Gm-Gg: AZFdTZchXbCknSqMLAvyIWl8gehzkS3iWXvc3QZWX2c7VdD6SFttU+RjiEIQF3McJux i/plMuSAU9vSt/Qvf+yzK/jkkqRTWBSF3vMsmRFMSMHjVsP/UiCwzsVH9Jmz1edeVmRYAhZ7G7D OqqpfQFXaXbwjEflb5waYqenBcxR9S+e+RURnJKXutaQ3NovKxwgexDXr+vOhcyQ+NVXMQglEph W7cXcIKXW3XeVDFUl7xZR6lMcc9VGfIcz+lSVOpAFFN5QaiO/M22Cpzl8+zaL1ojB6BUztqc85Q ARlBO4lShwBYQzvBV+rKt/OZ4hr6eX8qHnaKIlRVSbM4CPxdHSmzeDT7hFNGQLDPekYB4I+WCl5 RElQHcLS9Nk+uiyC7vQBTwmMQ62Md3uWaz0WxtpK0J/MCW/3xEvt6rIq4ypGYww3KJ6/pz9ejK/ IIw9dxuJO0ANSJcwVFVFBfV+U5zlQneXLkFf9ekitTycVCGlMw26Yxi79v7QnTrP2/7z7vQba8z Iq8jVNC47GSjA1NbWCwm3PGM/4ir/Rcxn2TJWe49dOKauSL1zBSrY5Cfn8AD7/KEQG2WmANSjAG GmoImpClljnOXqv/JuK5QO2H41z4jmyadSWFB4GJjw== 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) 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) Message-ID: Date: Thu, 3 Dec 2026 16:31:10 +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 4/7] commit-graph: expose function to validate a commit graph chain 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-4-31f2341a9932@pks.im> Content-Language: en-US From: Kaartic Sivaraam In-Reply-To: <20261120-pks-odb-pluggable-commit-graphs-v2-4-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: > 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