From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: X-Spam-Status: No, score=1.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,LIST_MIRROR_RECEIVED,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4D8591F452 for ; Fri, 20 Oct 2023 10:23:20 +0000 (UTC) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 23C9B282444 for ; Fri, 20 Oct 2023 10:23:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 936AC171A7; Fri, 20 Oct 2023 10:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB9E015EB6 for ; Fri, 20 Oct 2023 10:23:10 +0000 (UTC) Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D98D49 for ; Fri, 20 Oct 2023 03:23:08 -0700 (PDT) Received: (qmail 15474 invoked by uid 109); 20 Oct 2023 10:23:08 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 20 Oct 2023 10:23:08 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 12846 invoked by uid 111); 20 Oct 2023 10:23:13 -0000 Received: from coredump.intra.peff.net (HELO coredump.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 20 Oct 2023 06:23:13 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 20 Oct 2023 06:23:07 -0400 From: Jeff King To: Taylor Blau Cc: git@vger.kernel.org, Junio C Hamano Subject: Re: [PATCH 0/8] chunk-format: introduce `pair_chunk_expect()` convenience API Message-ID: <20231020102307.GB2673857@coredump.intra.peff.net> References: <20231009205544.GA3281950@coredump.intra.peff.net> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Unsubscribe-Post: List-Unsubscribe=One-Click On Fri, Oct 13, 2023 at 03:25:12PM -0400, Taylor Blau wrote: > While reviewing this series, I noticed a couple of spots that would be > helped by having a convenience function that stores the start of a > chunk in a designated location *after* checking that the chunk has the > expected size. > > I called this function `pair_chunk_expect()` and touched up seven spots > that I think could benefit from having a convenience function like this. > > This applies directly on top of 'jk/chunk-bounds'. Thanks in advance for > your review! I'm still a little skeptical of this approach, just because I think it it discourages adding further checks. And in particular, I was planning to add monotonicity checks to the midx OIDF chunk based on the discussion in the earlier thread. And likewise, I think I probably should have put the commit-graph checks into its OIDF reader, rather than saving them for verify_commit_graph_lite(). That would match the way we check the validity of the other chunks. I haven't actually started writing those patches, though, so I'm not sure of the full details yet. -Peff