History

checkpatch: support "base-commit:" format

In order to support the get-lore-mbox.py tool described in [1], I ran: git format-patch --base=<commit> --cover-letter <revrange> ... which generated a "base-commit: <commit-hash>" tag at the end of the cover letter. However, checkpatch.pl generated an error upon encounting "base-commit:" in the cover letter: "ERROR: Please use git commit description style..." ... because it found the "commit" keyword, and failed to recognize that it was part of the "base-commit" phrase, and as such, should not be subjected to the same commit description style rules. Update checkpatch.pl to include a special case for "base-commit:" (at the start of the line, possibly with some leading whitespace) so that that tag no longer generates a checkpatch error. [1] https://lwn.net/Articles/811528/ "Better tools for kernel developers"

John Hubbard committed 6 years ago

Commit a8972571 parent c8df0ab1 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -2780,7 +2780,7 @@ sub process { · 2779 unmodified lines
2780 2780
2781# Check for git id commit length and improperly formed commit descriptions2781# Check for git id commit length and improperly formed commit descriptions
2782 if ($in_commit_log && !$commit_log_possible_stack_dump &&2782 if ($in_commit_log && !$commit_log_possible_stack_dump &&
2783 $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i &&2783 $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
2784 $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&2784 $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
2785 ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||2785 ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
2786 ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&2786 ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&