Open Source Telephony
 help / color / mirror / Atom feed
From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/4] Add git commit header and description check
Date: Mon, 19 Jul 2010 14:19:28 +0800	[thread overview]
Message-ID: <1279520369-13214-3-git-send-email-yang.gu@intel.com> (raw)
In-Reply-To: <1279520369-13214-1-git-send-email-yang.gu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

---
 test/checkpatch.pl |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/test/checkpatch.pl b/test/checkpatch.pl
index 2d5ece7..767670d 100755
--- a/test/checkpatch.pl
+++ b/test/checkpatch.pl
@@ -1260,6 +1260,24 @@ sub process {
 
 		$cnt_lines++ if ($realcnt != 0);
 
+#check the commit header and description
+        if ($line =~ /Subject: \[PATCH.*\] (.*)/) {
+            my $header = $1;
+            if (length($header) > 50) {
+            	ERROR("Commit header exceeds the limitation of 50 characters\n");
+            }            
+            my @desc;
+            my $desc_linenr = $linenr;
+            my $desc_line = $lines[$desc_linenr++];
+            while ($desc_line ne "---") {
+                if (length($desc_line) > 72) {               
+                    ERROR("Commit description exceeds the limitation of 72 characters\n#".($desc_linenr-$linenr-1).": ".$desc_line."\n");   
+                }
+                $desc_line = $lines[$desc_linenr++];
+            }
+            
+        }
+
 #check the patch for a signoff:
 		if ($line =~ /^\s*signed-off-by:/i) {
 			# This is a signoff, if ugly, so do not double report.
-- 
1.7.0.4


  parent reply	other threads:[~2010-07-19  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19  6:19 [PATCH 1/4] Add coding style document Yang Gu
2010-07-19  6:19 ` [PATCH 2/4] Add original patch format checking script Yang Gu
2010-07-19 17:50   ` Denis Kenzior
2010-07-19  6:19 ` Yang Gu [this message]
2010-07-19  6:19 ` [PATCH 4/4] Dont check Signed-off-by by default Yang Gu
2010-07-19 17:45 ` [PATCH 1/4] Add coding style document Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279520369-13214-3-git-send-email-yang.gu@intel.com \
    --to=yang.gu@intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox