From: Felipe Balbi <balbi@ti.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Felipe Balbi <balbi@ti.com>
Subject: [PATCH] scripts: checkpatch: ignore stable commit annotation
Date: Tue, 30 Jun 2015 17:07:43 -0500 [thread overview]
Message-ID: <1435702063-12871-1-git-send-email-balbi@ti.com> (raw)
When running scripts/checkpatch.pl on stable commits,
we always get the error for not using 12-character
commit hash abbreviation with shortlog within ("").
Because that's actually a false positive, let's ignore
stable commit annotation.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
scripts/checkpatch.pl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 90e1edc8dd42..2ad0ef46ad08 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2320,6 +2320,7 @@ sub process {
if ($in_commit_log && $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i) {
my $init_char = $1;
my $orig_commit = lc($2);
+ my $stable = 0;
my $short = 1;
my $long = 0;
my $case = 1;
@@ -2330,6 +2331,7 @@ sub process {
my $orig_desc = "commit description";
my $description = "";
+ $stable = 1 if ($line =~ /\bcommit\s+[0-9a-f]{40}\s+upstream\./i);
$short = 0 if ($line =~ /\bcommit\s+[0-9a-f]{12,40}/i);
$long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i);
$space = 0 if ($line =~ /\bcommit [0-9a-f]/i);
@@ -2355,7 +2357,7 @@ sub process {
($id, $description) = git_commit_info($orig_commit,
$id, $orig_desc);
- if ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens) {
+ if (!$stable && ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) {
ERROR("GIT_COMMIT_ID",
"Please use git commit description style 'commit <12+ chars of sha1> (\"<title line>\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr);
}
--
2.4.4
next reply other threads:[~2015-06-30 22:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 22:07 Felipe Balbi [this message]
2015-06-30 22:30 ` Joe Perches
2015-06-30 22:42 ` Felipe Balbi
2015-06-30 23:45 ` Greg KH
2015-07-01 0:53 ` Felipe Balbi
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=1435702063-12871-1-git-send-email-balbi@ti.com \
--to=balbi@ti.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®