From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276AbcGSJwG (ORCPT ); Tue, 19 Jul 2016 05:52:06 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35470 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbcGSJwE (ORCPT ); Tue, 19 Jul 2016 05:52:04 -0400 Date: Tue, 19 Jul 2016 10:51:59 +0100 From: Andy Whitcroft To: Joe Perches Cc: Andrew Morton , "Zhuo, Qiuxu" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: Yet another commit id improvement Message-ID: <20160719095159.GA6746@brain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Signed-off-by: Joe Perches > cc: "Zhuo, Qiuxu" > --- > scripts/checkpatch.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index a0e5112..8209ae5 100755 > --- 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? > $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i && > $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) { > my $init_char = "c"; -apw