mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philippe Schenker <philippe.schenker@toradex.com>
To: "joe@perches.com" <joe@perches.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>
Cc: "sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
	"dwaipayanray1@gmail.com" <dwaipayanray1@gmail.com>,
	"lukas.bulwahn@gmail.com" <lukas.bulwahn@gmail.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"niklas.soderlund@corigine.com" <niklas.soderlund@corigine.com>
Subject: Re: [PATCH] checkpatch: add check for fixes: tag
Date: Thu, 8 Sep 2022 10:01:38 +0000	[thread overview]
Message-ID: <e6493d2b73e0551f277ae7a7964bef7e4426d7ce.camel@toradex.com> (raw)
In-Reply-To: <1125e8a68a709e18b594f74fc9b25b9992b1582f.camel@perches.com>

On Wed, 2022-09-07 at 08:18 -0700, Joe Perches wrote:
> On Wed, 2022-09-07 at 14:35 +0200, Philippe Schenker wrote:
> > From: Philippe Schenker <philippe.schenker@toradex.com>
> > 
> > The page about submitting patches in
> > Documentation/process/submitting-patches.rst is very specific on how
> > that
> > tag should be formatted: 'Fixes: <12+ chars of sha1> (\"<title
> > line>\")'
> > 
> > Add a rule that warns if this format does not match. This commit is
> > introduced as in the past commits have been sent multiple times with
> > having the word commit also in the Fixes: tag which had to be
> > corrected
> > by the maintainers. [1]
> 
> I preferred your first patch that added the commit description match
> as that's a fairly common defect.

Hi Joe, thanks for your review!

This patch is my first one that I'm sending. I was not aware that Niklas
sent the exact same thing few days earlier. Maybe you mix these two
submissions. [1]

How do we proceed? I guess it is up to you which approach you like
better. Niklas has good parts in his submission which I could take in or
I contribute in his v2 of the patch.

Certainly, this shows that the check we're trying to add is helpful 🙂.

Anyway, I'll answer your comments that not already got answered by
Stephen.

[1]
https://lore.kernel.org/all/20220905105247.920676-1-niklas.soderlund@corigine.com/

> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -3438,6 +3438,13 @@ sub process {
> >                         }
> >                 }
> >  
> > +# Check fixes tag format
> > +               if ($in_commit_log && ($line =~ /^\s*Fixes:/i) &&
> > +                       !($line =~ /^\s*Fixes:\s[0-9a-
> > f]{12,40}\s\(\".*\"\)/)) {
> 
> All fixes lines should start in the first column.

Agree, I didn't want to make it too strict but this can be easily
changed of course.

> 
> This allows spaces at the start of the line and the only white space
> allowed after Fixes: and after the SHA1 should be a space not a tab.

Agree too, I'll change the regexp accordingly if you decide to go with
my submission.

> 
> I think the test better if it checks for a SHA1 after fixes.
> 
> And IMO
> 
>         !(foo =~ /bar.../)
> 
> is better written as
> 
>         foo !~ /bar.../
> 
> so
> 
>                 if ($in_commit_log &&
>                     $line =~ /^\s*Fixes:?\s*[0-9a-f]{5,}\b/i &&
>                     $line !~ /^Fixes: [0-9a-f]{12,40} \(\".*\"\)/)) {
> 
> Though it's arguable that the SHA1 should _only_ be length 12
> and not longer.
> 


  parent reply	other threads:[~2022-09-08 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 12:35 Philippe Schenker
2022-09-07 15:18 ` Joe Perches
2022-09-07 23:01   ` Stephen Rothwell
2022-09-08 10:01   ` Philippe Schenker [this message]
2022-09-08 14:41     ` niklas.soderlund

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=e6493d2b73e0551f277ae7a7964bef7e4426d7ce.camel@toradex.com \
    --to=philippe.schenker@toradex.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=niklas.soderlund@corigine.com \
    --cc=sfr@canb.auug.org.au \
    --cc=shawnguo@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®