All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Erkan Erdem <hexvalid@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Julian Braha <julianbraha@gmail.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ariel Marcovitch <arielmarcovitch@gmail.com>,
	Valentin Rothberg <valentinrothberg@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2] checkkconfigsymbols: resolve revisions before resetting the tree
Date: Fri, 4 Dec 2026 17:44:16 +0100	[thread overview]
Message-ID: <axLt4DHkpyl9V6JT@levanger> (raw)
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 <hexvalid@gmail.com>
> ---
> 
> 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

      parent reply	other threads:[~2026-12-04 16:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 10:37 [PATCH v2] checkkconfigsymbols: resolve revisions before resetting the tree Erkan Erdem
2026-09-15 11:43 ` Julian Braha
2026-09-15 23:36   ` Nathan Chancellor
2026-12-04 16:44 ` Nicolas Schier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axLt4DHkpyl9V6JT@levanger \
    --to=nsc@kernel.org \
    --cc=arielmarcovitch@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hexvalid@gmail.com \
    --cc=julianbraha@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=valentinrothberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.