From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbcGSKGD (ORCPT ); Tue, 19 Jul 2016 06:06:03 -0400 Received: from smtprelay0228.hostedemail.com ([216.40.44.228]:43832 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751959AbcGSKGA (ORCPT ); Tue, 19 Jul 2016 06:06:00 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2689:2828:2902:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:8957:10004:10400:10848:11026:11232:11658:11783:11914:12043:12438:12517:12519:12740:13069:13095:13311:13357:13439:13894:14181:14659:21063:21080:21433:30054:30064:30070:30080:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: brush93_6e49897448a17 X-Filterd-Recvd-Size: 2000 Message-ID: <1468922756.1900.51.camel@perches.com> Subject: Re: [PATCH] checkpatch: Yet another commit id improvement From: Joe Perches To: Andy Whitcroft Cc: Andrew Morton , "Zhuo, Qiuxu" , linux-kernel@vger.kernel.org Date: Tue, 19 Jul 2016 03:05:56 -0700 In-Reply-To: <20160719095159.GA6746@brain> References: <20160719095159.GA6746@brain> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-07-19 at 10:51 +0100, Andy Whitcroft wrote: > On Mon, Jul 18, 2016 at 12:27:42PM -0700, Joe Perches wrote: > > > > Using \b isn't good enough to isolate what appears to be a > > commit id in a commit message. > > > > Make sure there is a space or a quote like character after > > a continuous run of hexadecimal characters that could be > > a commit id. [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > > @@ -2460,9 +2460,9 @@ sub process { > >   > >  # Check for git id commit length and improperly formed commit descriptions > >   if ($in_commit_log && !$commit_log_possible_stack_dump && > > -     $line !~ /^\s*(?:Link|Patchwork|http|BugLink):/i && > > +     $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i && > >       ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i || > > -      ($line =~ /\b[0-9a-f]{12,40}\b/i && > > +      ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i && > If we expect a quote after would it be unreasonable to allow then at the > beginning too? Perhaps not.  The idea is the quote starts the commit description not ends the commit SHA-1 hash.