[PATCH] checkpatch: Allow bare SHA-1 hashes in checkpatch commits

Tiffany Yang posted 1 patch 2 months, 3 weeks ago
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
[PATCH] checkpatch: Allow bare SHA-1 hashes in checkpatch commits
Posted by Tiffany Yang 2 months, 3 weeks ago
Commit messages for changes to checkpatch may use the output of the
"--git" option to illustrate the changed behavior. For example:
        ./scripts/checkpatch.pl --git d1934ed9803c

Don't report an improperly formed commit description when the SHA-1 hash
is being used as an example input to the checkpatch script.

Signed-off-by: Tiffany Yang <ynaffit@google.com>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f9d14115c416..c81787538b35 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3358,6 +3358,7 @@ sub process {
 		    $in_commit_log && !$commit_log_possible_stack_dump &&
 		    $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
 		    $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
+		    $line !~ /^\s*(?:(\$|%)\s+)?\.\/scripts\/checkpatch\.pl\s(?:-g|--git)\s[0-9a-f]{5,40}/ &&
 		    (($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		      ($line =~ /\bcommit\s*$/i && defined($rawlines[$linenr]) && $rawlines[$linenr] =~ /^\s*[0-9a-f]{5,}\b/i)) ||
 		     ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
-- 
2.52.0.rc1.455.g30608eb744-goog