From: Peter Maydell <[email protected]>

The checkpatch.pl script insists that Fixes tags are at the start of
each line of its input. Although this is where they ought to be
in the commit message, it is not where the script will see them
in common usage patterns like

  git show <hash> | ./scripts/checkpatch.pl -

because 'git show' prefaces each line of the commit message body with
four spaces.  Allow spaces before the Fixes tag; this matches how we
check for e.g.  Signed-off-by: tags.

Fixes: 910e1d41be6b2 ("scripts/checkpatch: validate Fixes: tag format and 
commit ancestry")
Reported-by: Stefano Garzarella <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Tested-by: Stefano Garzarella <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5df266acb172..82f62f602125 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]/);
 
-- 
2.55.0


Reply via email to