lkml.org 
[lkml]   [2009]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] checkpatch: Warn on empty commit log bodies
Try to help ensure that e-mailed patches have some commit log text in
the body of the e-mail by warning if we can't find any lines that look
like a header of some kind prior to the Signed-off-by.

Signed-off-by: Mark Brown <broonie@sirena.org.uk>
---
scripts/checkpatch.pl | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 45eb0ae..d162421 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1072,6 +1072,7 @@ sub process {

our $clean = 1;
my $signoff = 0;
+ my $headers = 0;
my $is_patch = 0;

our @report = ();
@@ -1258,6 +1259,11 @@ sub process {

$cnt_lines++ if ($realcnt != 0);

+ # Check for a RFC822 style header
+ if ($line =~ /^([a-z0-9-]+:|From )/i) {
+ $headers++;
+ }
+
#check the patch for a signoff:
if ($line =~ /^\s*signed-off-by:/i) {
# This is a signoff, if ugly, so do not double report.
@@ -1270,6 +1276,14 @@ sub process {
WARN("space required after Signed-off-by:\n" .
$herecurr);
}
+
+ # There should be at least 1 line of ordinary
+ # text for the body of the commit log prior to
+ # the signoff.
+ if ($linenr - $headers < 2) {
+ print $headers . $linenr . "\n";
+ WARN("no body for commit log");
+ }
}

# Check for wrappage within a valid hunk of the file
--
1.5.6.3


\
 
 \ /
  Last update: 2009-02-27 19:09    [W:0.131 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site