public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Zhuo, Qiuxu" <qiuxu.zhuo@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: Yet another commit id improvement
Date: Tue, 19 Jul 2016 10:51:59 +0100	[thread overview]
Message-ID: <20160719095159.GA6746@brain> (raw)
In-Reply-To: <fdd22b47463a21c21132edbb8aa35e372950a1e6.1468869915.git.joe@perches.com>

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 <joe@perches.com>
> cc: "Zhuo, Qiuxu" <qiuxu.zhuo@intel.com>
> ---
>  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

  reply	other threads:[~2016-07-19  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 19:27 [PATCH] checkpatch: Yet another commit id improvement Joe Perches
2016-07-19  9:51 ` Andy Whitcroft [this message]
2016-07-19 10:05   ` Joe Perches
2016-07-21 12:27     ` Andy Whitcroft

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=20160719095159.GA6746@brain \
    --to=apw@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiuxu.zhuo@intel.com \
    /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