From: "Ricardo B. Marlière (SUSE)" <ricardo@marliere.net>
To: "Petr Vorel" <pvorel@suse.cz>, <linux-kernel@vger.kernel.org>
Cc: "Andy Whitcroft" <apw@canonical.com>,
"Joe Perches" <joe@perches.com>,
"Dwaipayan Ray" <dwaipayanray1@gmail.com>,
"Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
"Cryolitia PukNgae" <cryolitia@uniontech.com>
Subject: Re: [PATCH RESEND 1/1] checkpatch: Skip CamelCase cache for --no-tree without root
Date: Mon, 10 Aug 2026 18:44:26 -0300 [thread overview]
Message-ID: <DKLLC28UG7B4.AE9P4UIQQDCQ@marliere.net> (raw)
In-Reply-To: <20260810161159.1044160-1-pvorel@suse.cz>
On Mon Aug 10, 2026 at 1:11 PM -03, Petr Vorel wrote:
> Running outside tree (--no-tree) without git root (--root DIR) is not
> doable because we have no include/ directory which could be cached. But
> 3445686af721 expected that we are always in Linux tree (w/a git).
> But --no-tree does not require --root. Therefore skip whole caching in
> that case.
>
> This fixes perl and find errors when running checkpatch.pl *with*
> --no-tree --strict and *without* --root:
>
> No structs that should be const will be found - file 'scripts/const_structs.checkpatch': No such file or directory
> Use of uninitialized value $root in concatenation (.) or string at scripts/checkpatch.pl line 1213.
> find: ‘/include’: No such file or directory
>
> Fixes: 3445686af721 ("checkpatch: ignore existing CamelCase uses from include/...")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> NOTE: I found that running checkpatch.pl on projects which vendored
> checkpatch.pl (e.g. LTP or u-boot).
>
> scripts/checkpatch.pl | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4f7325fd5825..9ce1113a64de 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1206,6 +1206,8 @@ sub seed_camelcase_includes {
> my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`;
> chomp $git_last_include_commit;
> $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
> + } elsif (not defined $root) {
> + return;
Reviewed-by: Ricardo B. Marlière (SUSE) <ricardo@marliere.net>
> } else {
> my $last_mod_date = 0;
> $files = `find $root/include -name "*.h"`;
prev parent reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 16:11 [PATCH RESEND 1/1] checkpatch: Skip CamelCase cache for --no-tree without root Petr Vorel
2026-08-10 21:44 ` Ricardo B. Marlière (SUSE) [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=DKLLC28UG7B4.AE9P4UIQQDCQ@marliere.net \
--to=ricardo@marliere.net \
--cc=apw@canonical.com \
--cc=cryolitia@uniontech.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=pvorel@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox