From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbcGUM2D (ORCPT ); Thu, 21 Jul 2016 08:28:03 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35037 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbcGUM2B (ORCPT ); Thu, 21 Jul 2016 08:28:01 -0400 Date: Thu, 21 Jul 2016 13:27:56 +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: <20160721122756.GF6746@brain> References: <20160719095159.GA6746@brain> <1468922756.1900.51.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1468922756.1900.51.camel@perches.com> 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 Tue, Jul 19, 2016 at 03:05:56AM -0700, Joe Perches wrote: > 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. Then carry on as before. Looks fine. -apw