On 10/21/26 10:42, Stefano Garzarella wrote:
Hi Cédric,

On Thu, 6 Aug 2026 at 19:15, Cédric Le Goater <[email protected]> wrote:

Adapt the kernel's checkpatch Fixes: tag validation for QEMU.

Add a git_commit_info() helper to resolve commit hashes and validate
the Fixes: tag in commit messages. The canonical form is:

   Fixes: <12+ chars of sha1> ("<title line>")

The check validates capitalization, spacing, hash length, lowercase
hex, and quoted title. When the format is wrong and the commit can
be resolved, suggest the corrected Fixes: line.

I had this strange suggestion while checking a patch I just sent[1]
applied on master (with this commit merged):

$ ./scripts/checkpatch.pl --branch master..HEAD --codespell
WARNING: Please use correct Fixes: style 'Fixes: <12+ chars of sha1> ("<title line>")' - 
ie: 'Fixes: c1d466d267cf ("backends/igvm: Add IGVM loader and configuration")'
#19:
     Fixes: c1d466d267cf ("backends/igvm: Add IGVM loader and configuration")

total: 0 errors, 1 warnings, 21 lines checked

Commit bfd67b5941a3 (backends/igvm: fix parameter area entries leak) has style 
problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.


An LLM suggested this and fixed the issue on my side:

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5df266acb1..82f62f6021 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1889,7 +1889,7 @@ sub process {
if ($line !~ /^\s*Fixes:\s+CVE/i) {
                                 my $tag_case = not ($tag eq "Fixes:");
-                               my $tag_space = not ($line =~ /^fixes:? 
[0-9a-f]{5,40}/i);
+                               my $tag_space = not ($line =~ /^\s*fixes:? 
[0-9a-f]{5,40}/i);
                                 my $id_length = not ($orig_commit =~ 
/^[0-9a-f]{12,40}$/);
                                 my $id_case = not ($orig_commit !~ /[A-F]/);

Since I don't know perl at all, please check it and feel free to submit
this change or another ;-)


This is just a regexp and it is correct :) I see Peter fixed it already.

Thanks for the report.

C.


Reply via email to