From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796402672; b=GiW1HzKnH21B/03P03nX8ShDATEJrOtzPIKCKaBg6KOH9Lnri3B89UqDzd7PPvf5chsM AHjVuCca7bXmwoZE7ugltRuYG0b6pntYgnQzCM0Fy6sZM2w6+iYLnPy8IL/V/kFlyQ2EU mOgtcWuNukLvpYhPy9i7agNaZRVmSqEqXnINiWU8Nibsj64M/3oTQJ7jJ9SNFK/Cvuyt6 YpppwjxCPOPth/QSerw3GvS3LEnGAIrHPehrlMP0lBTTiO1dMQ9ySaAyUl59GcVdv8Pnf BhNeTNVx0U1DRrXCoI27fkySdX7cru/H0lWVHKhLPxajJJwNDiC8dLnBwlNaopebrzg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402672; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=ePQclh6JiJ4mvTJV/YmRJM9GVD1x7XYzyAuD6H8b8i8=; b=dUuksI3o/Uz+p1sJ+PVh4SEOB3AAsEclmM4mkzh2mRsSlCKFbRZQr/AjsCdq2K8R29SP 3qSo/FJSJ7mBnvBagrx5KXkiyZYq2KtOKVv1/Co433j52rM+2f4MY/P0YNBi5yDpkj+8c 2o0T0hakhSg4As1kG/Td6t+66Q3uxtegaZeYmQo3s2m4B+UIX/8KOIWdSTquj7hnKa8wh oW6L/cwVrL+yNPWGyE84X0I1yx7j3kFpqBj4uqDXr5n4fLtAE5bPlml0jtISA85cG3EMp T82KN2/KHgAPXbB34lOUHdW/isdld7GlDYZ6YrgNhn17b3kerrvniG9NEhHa8uU2v2w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HMTLWl+0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id 795FA606A322; Fri, 4 Dec 2026 16:44:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HMTLWl+0 Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id D53291F00897; Fri, 4 Dec 2026 16:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796402672; bh=ePQclh6JiJ4mvTJV/YmRJM9GVD1x7XYzyAuD6H8b8i8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HMTLWl+0oNTwYPkJ8SWQjOFvnJG5hHD/Yqeqw8nResDDuuzAO9TCbbTUUN4fEoKOI pIQGLjsGVYXQaxli5eJq8nVBtpVADK1cwO0WfV2mUOhM32sTl8D99ha3vg6uXdrn1K 1QytSxOh8ipL+RR/Y5Sj42AtfDAGUZMJeSCrah46E4XuEEP5bdhnb7s0JSH2P7syzT fbkGl6V4osDtAgFv0obi0U/dGVj/BER4GUSsMdIB1lWr9VUPAA5WkHXMZD0wx+qmNp QH1M2cGlFOGgIZrxVrplbEwfMUJdjztQpcA0Nl7Wb0DL57rBamFkINxiWMZvaRL8Da e0yOc93TlRuxw== Date: Fri, 4 Dec 2026 17:44:16 +0100 From: Nicolas Schier To: Erkan Erdem Cc: Nathan Chancellor , Julian Braha , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Ariel Marcovitch , Valentin Rothberg , Masahiro Yamada , Greg Kroah-Hartman Subject: Re: [PATCH v2] checkkconfigsymbols: resolve revisions before resetting the tree Message-ID: Mail-Followup-To: Nicolas Schier , Erkan Erdem , Nathan Chancellor , Julian Braha , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Ariel Marcovitch , Valentin Rothberg , Masahiro Yamada , Greg Kroah-Hartman References: <20260907103739.23212-3-hexvalid@gmail.com> X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260907103739.23212-3-hexvalid@gmail.com> On Mon, Sep 07, 2026 at 01:37:39PM +0300, Erkan Erdem wrote: > The commit comparison resets the current branch to commit_a before > resolving commit_b. If the second revision is HEAD or the current branch > name, it then resolves to the first revision. For example, --diff > HEAD^..HEAD compares the parent with itself and silently misses newly > undefined symbols. The same problem affects --commit with the current > branch name. > > Resolve and verify both revisions as commits before the first reset. > This keeps their meaning stable throughout the comparison and rejects > invalid endpoints before changing the working tree. > > Keep lookup diagnostics separate from the resolved hashes. Use the > resolved range for --find too, since resetting also updates ORIG_HEAD. > > Fixes: b1a3f243485f ("checkkconfigsymbols.py: make it Git aware") > Link: https://lore.kernel.org/20210901145212.478066-1-arielmarcovitch@gmail.com/ > Assisted-by: LLM > Signed-off-by: Erkan Erdem > --- > > Changes in v2, addressing Julian Braha's review: > - Submit this fix independently of the unrelated Kconfig input fix. > - No code changes from v1. > - Include the original Git-awareness author and contributors to the > previous HEAD-reference fix in Cc. > > v1: https://lore.kernel.org/all/20260905123237.40670-2-hexvalid@gmail.com/ > > An AI coding assistant found the issue, prepared the fix and changelog, > and ran the original verification. The same assistant prepared this > standalone v2 submission. > > Validation: > - The code is unchanged from v1, which passed 15 actual-CLI cases in > disposable Git repositories, including HEAD-relative ranges, branch > names, hashes, tags, annotated tags, ambiguous names, --commit, > --find, ORIG_HEAD and invalid or non-commit endpoints. > - Those checks verified HEAD, current branch, index and tracked file > contents after every invocation. > - The script in mainline df2908090cda368b01ff43709f51890076c56157 still > matches the original pre-fix file; this patch applies independently. > > scripts/checkkconfigsymbols.py | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py > index 36c920e71..e0a1a631b 100755 > --- a/scripts/checkkconfigsymbols.py > +++ b/scripts/checkkconfigsymbols.py > @@ -150,6 +150,13 @@ def print_undefined_symbols(): > undefined_a = {} > undefined_b = {} > > + commit_a = execute(["git", "rev-parse", "--verify", commit_a + "^{commit}"], > + stderr=None).strip() > + commit_b = execute(["git", "rev-parse", "--verify", commit_b + "^{commit}"], > + stderr=None).strip() Thanks, I like that fix. Are you planning to send a v3, respecting the feedback from Julian and Nathan? -- Nicolas