mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Pierre-Clément Tosi" <ptosi@google.com>,
	"Andy Whitcroft" <apw@canonical.com>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Fix bad FILE_PATH_CHANGES on headers
Date: Sat, 07 Nov 2026 18:17:28 -0800	[thread overview]
Message-ID: <22778bf51435b9e03d2a18bba70abb729bc003f7.camel@perches.com> (raw)
In-Reply-To: <20261107-checkpatch-file_path_changes-v1-1-8b11814560d8@google.com>

On Sat, 2026-11-07 at 16:02 +0100, Pierre-Clément Tosi wrote:
> The FILE_PATH_CHANGES warning ("added, moved or deleted file(s), does
> MAINTAINERS need updating?") added by commit 13f1937ef339 ("checkpatch:
> emit a warning on file add/move/delete") was guarded by !$in_commit_log
> so that commit message lines would not be mistaken for diffstat or diff
> header lines.
> 
> However, it was still evaluated on the initial email header lines
> ($in_header_lines == 1) such that a title using the rename notation e.g.
> 
>     Subject: [PATCH] foo: rework bar_{get=>set}_baz()
> 
> triggers a false-positive warning. Furthermore, that same (wrong) code
> path sets $is_patch prematurely.

cute.  Thanks again.

Acked-by: Joe Perches <joe@perches.com>

> 
> Instead, only test for FILE_PATH_CHANGES when !$in_header_lines.
> 
> Fixes: 13f1937ef339 ("checkpatch: emit a warning on file add/move/delete")
> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b8b64f720191..03e3e4b72cdd 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3481,7 +3481,7 @@ sub process {
>  		}
>  
>  # Check for added, moved or deleted files
> -		if (!$reported_maintainer_file && !$in_commit_log &&
> +		if (!$reported_maintainer_file && !$in_commit_log && !$in_header_lines &&
>  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
>  		     $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
>  		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
> 
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20261107-checkpatch-file_path_changes-ac920c85bc7e
> 
> Best regards,

      reply	other threads:[~2026-11-08  2:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 15:02 Pierre-Clément Tosi
2026-11-08  2:17 ` Joe Perches [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=22778bf51435b9e03d2a18bba70abb729bc003f7.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptosi@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®