Skip to content

Commit

Permalink
BACKPORT: checkpatch: special audit for revert commit line
Browse files Browse the repository at this point in the history
Currently checkpatch.pl does not recognize git's default
commit revert message and will complain about the hash format.
Add special audit for revert commit message line to fix it.

Signed-off-by: Wei Wang <wvw@google.com>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 37158168
Test: checkpatch.pl --patch [diff] and no longer see failure
Change-Id: I65cf9a46874621dd6d5c349d2d3ca3b862d61ba3
  • Loading branch information
weivincewang committed Apr 11, 2017
1 parent 2f498a6 commit b6fe604
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2162,6 +2162,7 @@ sub process {

# Check for improperly formed commit descriptions
if ($in_commit_log &&
$line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
$line =~ /\bcommit\s+[0-9a-f]{5,}/i &&
!($line =~ /\b[Cc]ommit [0-9a-f]{12,40} \("/ ||
($line =~ /\b[Cc]ommit [0-9a-f]{12,40}\s*$/ &&
Expand Down

0 comments on commit b6fe604

Please sign in to comment.