linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: add warning for non-lore mailing list URLs
@ 2020-12-17 23:56 Bjorn Helgaas
  2020-12-18  0:50 ` Joe Perches
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2020-12-17 23:56 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
as lore.kernel.org because they use different styles, add advertising, and
may disappear in the future.  The lore archives are more consistent and
more likely to stick around, so prefer https://lore.kernel.org URLs when
they exist.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
Sample commits for testing with "checkpatch -g":

  bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
  fdec2a9ef853 www.spinics.net/lists/kvm-arm
  1cdca16c043a www.spinics.net/lists/linux-mmc
  48ea02184a9d www.spinics.net/lists/linux-pci
  f32ae8a5f131 www.spinics.net/lists/netdev
  b7dca6dd1e59 lkml.org
  265df32eae58 lkml.org/lkml/
  4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
  c03914b7aa31 marc.info/?l=linux-mm
  f108c887d089 marc.info/?l=linux-netdev
  7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
  dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
  b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
  5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
  3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
  a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
---
 scripts/checkpatch.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 00085308ed9d..ac8e99285b2a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -564,6 +564,17 @@ sub find_standard_signature {
 	return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+	freedesktop.org/archives/dri-devel|
+	lists.infradead.org|
+	lkml.org|
+	mail-archive.com|
+	mailman.alsa-project.org/pipermail|
+	marc.info|
+	ozlabs.org/pipermail|
+	spinics.net
+)};
+
 our @typeListMisordered = (
 	qr{char\s+(?:un)?signed},
 	qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3101,6 +3112,12 @@ sub process {
 			}
 		}
 
+# Check for mailing list archives other than lore.kernel.org
+		if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
+			WARN("PREFER_LORE_ARCHIVE",
+			     "Use lore.kernel.org archive links when possible; see https://lore.kernel.org/lists.html\n" . $herecurr);
+		}
+
 # Check for added, moved or deleted files
 		if (!$reported_maintainer_file && !$in_commit_log &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2020-12-17 23:56 [PATCH] checkpatch: add warning for non-lore mailing list URLs Bjorn Helgaas
@ 2020-12-18  0:50 ` Joe Perches
  2021-02-10  8:22   ` Kees Cook
  0 siblings, 1 reply; 19+ messages in thread
From: Joe Perches @ 2020-12-18  0:50 UTC (permalink / raw)
  To: Bjorn Helgaas, Andy Whitcroft; +Cc: linux-kernel, Bjorn Helgaas

On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> as lore.kernel.org because they use different styles, add advertising, and
> may disappear in the future.  The lore archives are more consistent and
> more likely to stick around, so prefer https://lore.kernel.org URLs when
> they exist.

Hi Bjorn.

I like the idea, thanks, but a couple notes.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -564,6 +564,17 @@ sub find_standard_signature {
>  	return "";
>  }
 
> +our $obsolete_archives = qr{(?xi:
> +	freedesktop.org/archives/dri-devel|
> +	lists.infradead.org|
> +	lkml.org|
> +	mail-archive.com|
> +	mailman.alsa-project.org/pipermail|
> +	marc.info|
> +	ozlabs.org/pipermail|
> +	spinics.net
> +)};

Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.


> @@ -3101,6 +3112,12 @@ sub process {
>  			}
>  		}
>  
> +# Check for mailing list archives other than lore.kernel.org
> +		if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {

The https?:// doesn't seem necessary.  Perhaps:

		if ($line =~ m{\b$obsolete_archives}) {

> +			WARN("PREFER_LORE_ARCHIVE",
> +			     "Use lore.kernel.org archive links when possible; see https://lore.kernel.org/lists.html\n" . $herecurr);

Perhaps:
			     "Prefer lore.kernel.org links. see: https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n" . $herecurr);

So maybe instead:
---
 scripts/checkpatch.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 00085308ed9d..c2a324d628a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -564,6 +564,17 @@ sub find_standard_signature {
 	return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+	\Qfreedesktop.org/archives/dri-devel\E |
+	\Qlists.infradead.org\E |
+	\Qlkml.org\E |
+	\Qmail-archive.com\E |
+	\Qmailman.alsa-project.org/pipermail\E |
+	\Qmarc.info\E |
+	\Qozlabs.org/pipermail\E |
+	\Qspinics.net\E
+)};
+
 our @typeListMisordered = (
 	qr{char\s+(?:un)?signed},
 	qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3101,6 +3112,12 @@ sub process {
 			}
 		}
 
+		# Check for mailing list archives other than lore.kernel.org
+		if ($rawline =~ m{\b$obsolete_archives}) {
+			WARN("PREFER_LORE_ARCHIVE",
+			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
+		}
+
 # Check for added, moved or deleted files
 		if (!$reported_maintainer_file && !$in_commit_log &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2020-12-18  0:50 ` Joe Perches
@ 2021-02-10  8:22   ` Kees Cook
  2021-02-10 17:45     ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Kees Cook @ 2021-02-10  8:22 UTC (permalink / raw)
  To: Joe Perches; +Cc: Bjorn Helgaas, Andy Whitcroft, linux-kernel, Bjorn Helgaas

On Thu, Dec 17, 2020 at 04:50:41PM -0800, Joe Perches wrote:
> On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > as lore.kernel.org because they use different styles, add advertising, and
> > may disappear in the future.  The lore archives are more consistent and
> > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > they exist.
> 
> Hi Bjorn.
> 
> I like the idea, thanks, but a couple notes.
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -564,6 +564,17 @@ sub find_standard_signature {
> >  	return "";
> >  }
>  
> > +our $obsolete_archives = qr{(?xi:
> > +	freedesktop.org/archives/dri-devel|
> > +	lists.infradead.org|
> > +	lkml.org|
> > +	mail-archive.com|
> > +	mailman.alsa-project.org/pipermail|
> > +	marc.info|
> > +	ozlabs.org/pipermail|
> > +	spinics.net
> > +)};
> 
> Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.
> 
> 
> > @@ -3101,6 +3112,12 @@ sub process {
> >  			}
> >  		}
> >  
> > +# Check for mailing list archives other than lore.kernel.org
> > +		if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
> 
> The https?:// doesn't seem necessary.  Perhaps:
> 
> 		if ($line =~ m{\b$obsolete_archives}) {
> 
> > +			WARN("PREFER_LORE_ARCHIVE",
> > +			     "Use lore.kernel.org archive links when possible; see https://lore.kernel.org/lists.html\n" . $herecurr);
> 
> Perhaps:
> 			     "Prefer lore.kernel.org links. see: https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n" . $herecurr);
> 
> So maybe instead:
> ---
>  scripts/checkpatch.pl | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 00085308ed9d..c2a324d628a6 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -564,6 +564,17 @@ sub find_standard_signature {
>  	return "";
>  }
>  
> +our $obsolete_archives = qr{(?xi:
> +	\Qfreedesktop.org/archives/dri-devel\E |
> +	\Qlists.infradead.org\E |
> +	\Qlkml.org\E |
> +	\Qmail-archive.com\E |
> +	\Qmailman.alsa-project.org/pipermail\E |
> +	\Qmarc.info\E |
> +	\Qozlabs.org/pipermail\E |
> +	\Qspinics.net\E
> +)};
> +
>  our @typeListMisordered = (
>  	qr{char\s+(?:un)?signed},
>  	qr{int\s+(?:(?:un)?signed\s+)?short\s},
> @@ -3101,6 +3112,12 @@ sub process {
>  			}
>  		}
>  
> +		# Check for mailing list archives other than lore.kernel.org
> +		if ($rawline =~ m{\b$obsolete_archives}) {
> +			WARN("PREFER_LORE_ARCHIVE",
> +			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
> +		}
> +
>  # Check for added, moved or deleted files
>  		if (!$reported_maintainer_file && !$in_commit_log &&
>  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
> 
> 

Ah, nice. Yes, this would be great to get added. Joe, can you respin as
a full path? Please consider it:

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2021-02-10  8:22   ` Kees Cook
@ 2021-02-10 17:45     ` Bjorn Helgaas
  0 siblings, 0 replies; 19+ messages in thread
From: Bjorn Helgaas @ 2021-02-10 17:45 UTC (permalink / raw)
  To: Kees Cook; +Cc: Joe Perches, Andy Whitcroft, linux-kernel, Bjorn Helgaas

On Wed, Feb 10, 2021 at 12:22:35AM -0800, Kees Cook wrote:
> On Thu, Dec 17, 2020 at 04:50:41PM -0800, Joe Perches wrote:
> > On Thu, 2020-12-17 at 17:56 -0600, Bjorn Helgaas wrote:
> > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > 
> > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > as lore.kernel.org because they use different styles, add advertising, and
> > > may disappear in the future.  The lore archives are more consistent and
> > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > they exist.
> > 
> > Hi Bjorn.
> > 
> > I like the idea, thanks, but a couple notes.
> > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -564,6 +564,17 @@ sub find_standard_signature {
> > >  	return "";
> > >  }
> >  
> > > +our $obsolete_archives = qr{(?xi:
> > > +	freedesktop.org/archives/dri-devel|
> > > +	lists.infradead.org|
> > > +	lkml.org|
> > > +	mail-archive.com|
> > > +	mailman.alsa-project.org/pipermail|
> > > +	marc.info|
> > > +	ozlabs.org/pipermail|
> > > +	spinics.net
> > > +)};
> > 
> > Strictly, these all need \Q \E escaping so uses like lkmlAorg do not match.
> > 
> > 
> > > @@ -3101,6 +3112,12 @@ sub process {
> > >  			}
> > >  		}
> > >  
> > > +# Check for mailing list archives other than lore.kernel.org
> > > +		if ($line =~ /(http|https):\/\/\S*$obsolete_archives/) {
> > 
> > The https?:// doesn't seem necessary.  Perhaps:
> > 
> > 		if ($line =~ m{\b$obsolete_archives}) {
> > 
> > > +			WARN("PREFER_LORE_ARCHIVE",
> > > +			     "Use lore.kernel.org archive links when possible; see https://lore.kernel.org/lists.html\n" . $herecurr);
> > 
> > Perhaps:
> > 			     "Prefer lore.kernel.org links. see: https://www.kernel.org/lore.html#linking-to-list-discussions-from-commits\n" . $herecurr);
> > 
> > So maybe instead:
> > ---
> >  scripts/checkpatch.pl | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 00085308ed9d..c2a324d628a6 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -564,6 +564,17 @@ sub find_standard_signature {
> >  	return "";
> >  }
> >  
> > +our $obsolete_archives = qr{(?xi:
> > +	\Qfreedesktop.org/archives/dri-devel\E |
> > +	\Qlists.infradead.org\E |
> > +	\Qlkml.org\E |
> > +	\Qmail-archive.com\E |
> > +	\Qmailman.alsa-project.org/pipermail\E |
> > +	\Qmarc.info\E |
> > +	\Qozlabs.org/pipermail\E |
> > +	\Qspinics.net\E
> > +)};
> > +
> >  our @typeListMisordered = (
> >  	qr{char\s+(?:un)?signed},
> >  	qr{int\s+(?:(?:un)?signed\s+)?short\s},
> > @@ -3101,6 +3112,12 @@ sub process {
> >  			}
> >  		}
> >  
> > +		# Check for mailing list archives other than lore.kernel.org
> > +		if ($rawline =~ m{\b$obsolete_archives}) {
> > +			WARN("PREFER_LORE_ARCHIVE",
> > +			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
> > +		}
> > +
> >  # Check for added, moved or deleted files
> >  		if (!$reported_maintainer_file && !$in_commit_log &&
> >  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
> > 
> > 
> 
> Ah, nice. Yes, this would be great to get added. Joe, can you respin as
> a full path? Please consider it:

I hate to ask Joe to rework *my* patch just because I've dropped the
ball on it!  Sorry, I'll try to resurrect this.

> Reviewed-by: Kees Cook <keescook@chromium.org>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-14 22:43           ` Bjorn Helgaas
@ 2022-11-14 22:50             ` Peter Collingbourne
  0 siblings, 0 replies; 19+ messages in thread
From: Peter Collingbourne @ 2022-11-14 22:50 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Mon, Nov 14, 2022 at 2:43 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Mon, Nov 07, 2022 at 01:00:59PM -0800, Peter Collingbourne wrote:
> > On Mon, Nov 7, 2022 at 12:54 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > >
> > > On Thu, Nov 03, 2022 at 06:34:31PM -0700, Peter Collingbourne wrote:
> > > > On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > > > > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > > > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > > > > >
> > > > > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > > > > may disappear in the future.  The lore archives are more consistent and
> > > > > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > > > > they exist.
> > > > > >
> > > > > > If the commit message contains a line like:
> > > > > >
> > > > > > Cc: linux-arm-kernel@lists.infradead.org
> > > > > >
> > > > > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > > > > restrict this to URLs?
> > > > >
> > > > > Yes, I believe this would probably work well enough:
> > > > > ---
> > > > >  scripts/checkpatch.pl | 3 ++-
> > > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > > index 7be93c3df2bcb..fe25642d8bacc 100755
> > > > > --- a/scripts/checkpatch.pl
> > > > > +++ b/scripts/checkpatch.pl
> > > > > @@ -3336,7 +3336,8 @@ sub process {
> > > > >                 }
> > > > >
> > > > >  # Check for mailing list archives other than lore.kernel.org
> > > > > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > > > > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > > > > +                   $rawline !~ /^\s*cc:/i) {
> > > >
> > > > Can we make this (to|cc): instead? Otherwise developers (like me) who
> > > > use custom scripts to add To: headers to their patches before passing
> > > > them to checkpatch.pl will also hit this warning if their patch is
> > > > being sent To: one of these mailing lists.
> > >
> > > Why not make it look for "http" instead of the absence of "cc"?
> >
> > "https" as well, but yes, that would make more sense to me, and would
> > be less likely to require user workarounds.
>
> Maybe like this?  (On top of my previous attempt, which is in -next)
>
>
> commit d15f85247948 ("checkpatch: warn only for URLs to non-lore archives")
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Mon Nov 14 16:33:12 2022 -0600
>
>     checkpatch: warn only for URLs to non-lore archives
>
>     Previously we warned for anything that contained the archive hostname, but
>     some email addresses also contain those hostnames, and we'd rather not warn
>     about those.  Only warn if we see "http" before the archive hostname.
>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Reviewed-by: Peter Collingbourne <pcc@google.com>

Peter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-07 21:00         ` Peter Collingbourne
@ 2022-11-14 22:43           ` Bjorn Helgaas
  2022-11-14 22:50             ` Peter Collingbourne
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2022-11-14 22:43 UTC (permalink / raw)
  To: Peter Collingbourne
  Cc: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Mon, Nov 07, 2022 at 01:00:59PM -0800, Peter Collingbourne wrote:
> On Mon, Nov 7, 2022 at 12:54 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > On Thu, Nov 03, 2022 at 06:34:31PM -0700, Peter Collingbourne wrote:
> > > On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > > > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > > > >
> > > > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > > > may disappear in the future.  The lore archives are more consistent and
> > > > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > > > they exist.
> > > > >
> > > > > If the commit message contains a line like:
> > > > >
> > > > > Cc: linux-arm-kernel@lists.infradead.org
> > > > >
> > > > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > > > restrict this to URLs?
> > > >
> > > > Yes, I believe this would probably work well enough:
> > > > ---
> > > >  scripts/checkpatch.pl | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > index 7be93c3df2bcb..fe25642d8bacc 100755
> > > > --- a/scripts/checkpatch.pl
> > > > +++ b/scripts/checkpatch.pl
> > > > @@ -3336,7 +3336,8 @@ sub process {
> > > >                 }
> > > >
> > > >  # Check for mailing list archives other than lore.kernel.org
> > > > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > > > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > > > +                   $rawline !~ /^\s*cc:/i) {
> > >
> > > Can we make this (to|cc): instead? Otherwise developers (like me) who
> > > use custom scripts to add To: headers to their patches before passing
> > > them to checkpatch.pl will also hit this warning if their patch is
> > > being sent To: one of these mailing lists.
> >
> > Why not make it look for "http" instead of the absence of "cc"?
> 
> "https" as well, but yes, that would make more sense to me, and would
> be less likely to require user workarounds.

Maybe like this?  (On top of my previous attempt, which is in -next)


commit d15f85247948 ("checkpatch: warn only for URLs to non-lore archives")
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Mon Nov 14 16:33:12 2022 -0600

    checkpatch: warn only for URLs to non-lore archives
    
    Previously we warned for anything that contained the archive hostname, but
    some email addresses also contain those hostnames, and we'd rather not warn
    about those.  Only warn if we see "http" before the archive hostname.
    
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    ---
    
    Sample commit for testing with "checkpatch -g":
    
      5e91e57e6809 Cc: linux-arm-kernel@lists.infradead.org

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1c3d13e65c2d..78cc595b98ce 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3336,7 +3336,7 @@ sub process {
 		}
 
 # Check for mailing list archives other than lore.kernel.org
-		if ($rawline =~ m{\b$obsolete_archives}) {
+		if ($rawline =~ m{http.*\b$obsolete_archives}) {
 			WARN("PREFER_LORE_ARCHIVE",
 			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
 		}

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-07 20:54       ` Bjorn Helgaas
@ 2022-11-07 21:00         ` Peter Collingbourne
  2022-11-14 22:43           ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Peter Collingbourne @ 2022-11-07 21:00 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Mon, Nov 7, 2022 at 12:54 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Thu, Nov 03, 2022 at 06:34:31PM -0700, Peter Collingbourne wrote:
> > On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > > >
> > > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > > may disappear in the future.  The lore archives are more consistent and
> > > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > > they exist.
> > > >
> > > > If the commit message contains a line like:
> > > >
> > > > Cc: linux-arm-kernel@lists.infradead.org
> > > >
> > > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > > restrict this to URLs?
> > >
> > > Yes, I believe this would probably work well enough:
> > > ---
> > >  scripts/checkpatch.pl | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index 7be93c3df2bcb..fe25642d8bacc 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -3336,7 +3336,8 @@ sub process {
> > >                 }
> > >
> > >  # Check for mailing list archives other than lore.kernel.org
> > > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > > +                   $rawline !~ /^\s*cc:/i) {
> >
> > Can we make this (to|cc): instead? Otherwise developers (like me) who
> > use custom scripts to add To: headers to their patches before passing
> > them to checkpatch.pl will also hit this warning if their patch is
> > being sent To: one of these mailing lists.
>
> Why not make it look for "http" instead of the absence of "cc"?

"https" as well, but yes, that would make more sense to me, and would
be less likely to require user workarounds.

Peter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-04  1:34     ` Peter Collingbourne
  2022-11-04  1:40       ` Joe Perches
@ 2022-11-07 20:54       ` Bjorn Helgaas
  2022-11-07 21:00         ` Peter Collingbourne
  1 sibling, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2022-11-07 20:54 UTC (permalink / raw)
  To: Peter Collingbourne
  Cc: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Thu, Nov 03, 2022 at 06:34:31PM -0700, Peter Collingbourne wrote:
> On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > >
> > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > may disappear in the future.  The lore archives are more consistent and
> > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > they exist.
> > >
> > > If the commit message contains a line like:
> > >
> > > Cc: linux-arm-kernel@lists.infradead.org
> > >
> > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > restrict this to URLs?
> >
> > Yes, I believe this would probably work well enough:
> > ---
> >  scripts/checkpatch.pl | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 7be93c3df2bcb..fe25642d8bacc 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3336,7 +3336,8 @@ sub process {
> >                 }
> >
> >  # Check for mailing list archives other than lore.kernel.org
> > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > +                   $rawline !~ /^\s*cc:/i) {
> 
> Can we make this (to|cc): instead? Otherwise developers (like me) who
> use custom scripts to add To: headers to their patches before passing
> them to checkpatch.pl will also hit this warning if their patch is
> being sent To: one of these mailing lists.

Why not make it look for "http" instead of the absence of "cc"?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-04  1:40       ` Joe Perches
@ 2022-11-04 16:49         ` Peter Collingbourne
  0 siblings, 0 replies; 19+ messages in thread
From: Peter Collingbourne @ 2022-11-04 16:49 UTC (permalink / raw)
  To: Joe Perches
  Cc: Bjorn Helgaas, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap,
	Linux Kernel Mailing List, Bjorn Helgaas

On Thu, Nov 3, 2022 at 6:41 PM Joe Perches <joe@perches.com> wrote:
>
> On Thu, 2022-11-03 at 18:34 -0700, Peter Collingbourne wrote:
> > On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > >
> > > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > > >
> > > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > > may disappear in the future.  The lore archives are more consistent and
> > > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > > they exist.
> > > >
> > > > If the commit message contains a line like:
> > > >
> > > > Cc: linux-arm-kernel@lists.infradead.org
> > > >
> > > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > > restrict this to URLs?
> > >
> > > Yes, I believe this would probably work well enough:
> > > ---
> > >  scripts/checkpatch.pl | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index 7be93c3df2bcb..fe25642d8bacc 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -3336,7 +3336,8 @@ sub process {
> > >                 }
> > >
> > >  # Check for mailing list archives other than lore.kernel.org
> > > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > > +                   $rawline !~ /^\s*cc:/i) {
> >
> > Can we make this (to|cc): instead? Otherwise developers (like me) who
> > use custom scripts to add To: headers to their patches before passing
> > them to checkpatch.pl will also hit this warning if their patch is
> > being sent To: one of these mailing lists.
>
> I think adding "To:" would be odd and unnecessary as it's not
> something that would actually be in a patch.
>
> You could use another front-end script to strip those "To:" from
> checkpatch inputs.

OK, I made that work, so I guess I don't mind much what we do here.

Peter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-04  1:34     ` Peter Collingbourne
@ 2022-11-04  1:40       ` Joe Perches
  2022-11-04 16:49         ` Peter Collingbourne
  2022-11-07 20:54       ` Bjorn Helgaas
  1 sibling, 1 reply; 19+ messages in thread
From: Joe Perches @ 2022-11-04  1:40 UTC (permalink / raw)
  To: Peter Collingbourne
  Cc: Bjorn Helgaas, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Thu, 2022-11-03 at 18:34 -0700, Peter Collingbourne wrote:
> On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
> > 
> > On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > > From: Bjorn Helgaas <bhelgaas@google.com>
> > > > 
> > > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > > as lore.kernel.org because they use different styles, add advertising, and
> > > > may disappear in the future.  The lore archives are more consistent and
> > > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > > they exist.
> > > 
> > > If the commit message contains a line like:
> > > 
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > 
> > > this patch causes checkpatch.pl to complain. Would it be possible to
> > > restrict this to URLs?
> > 
> > Yes, I believe this would probably work well enough:
> > ---
> >  scripts/checkpatch.pl | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 7be93c3df2bcb..fe25642d8bacc 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3336,7 +3336,8 @@ sub process {
> >                 }
> > 
> >  # Check for mailing list archives other than lore.kernel.org
> > -               if ($rawline =~ m{\b$obsolete_archives}) {
> > +               if ($rawline =~ m{\b$obsolete_archives} &&
> > +                   $rawline !~ /^\s*cc:/i) {
> 
> Can we make this (to|cc): instead? Otherwise developers (like me) who
> use custom scripts to add To: headers to their patches before passing
> them to checkpatch.pl will also hit this warning if their patch is
> being sent To: one of these mailing lists.

I think adding "To:" would be odd and unnecessary as it's not
something that would actually be in a patch.

You could use another front-end script to strip those "To:" from
checkpatch inputs.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-04  1:27   ` Joe Perches
@ 2022-11-04  1:34     ` Peter Collingbourne
  2022-11-04  1:40       ` Joe Perches
  2022-11-07 20:54       ` Bjorn Helgaas
  0 siblings, 2 replies; 19+ messages in thread
From: Peter Collingbourne @ 2022-11-04  1:34 UTC (permalink / raw)
  To: Joe Perches
  Cc: Bjorn Helgaas, Andrew Morton, Andy Whitcroft, Dwaipayan Ray,
	Lukas Bulwahn, Kees Cook, Randy Dunlap, linux-kernel,
	Bjorn Helgaas

On Thu, Nov 3, 2022 at 6:27 PM Joe Perches <joe@perches.com> wrote:
>
> On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> > On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > > From: Bjorn Helgaas <bhelgaas@google.com>
> > >
> > > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > > as lore.kernel.org because they use different styles, add advertising, and
> > > may disappear in the future.  The lore archives are more consistent and
> > > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > > they exist.
> >
> > If the commit message contains a line like:
> >
> > Cc: linux-arm-kernel@lists.infradead.org
> >
> > this patch causes checkpatch.pl to complain. Would it be possible to
> > restrict this to URLs?
>
> Yes, I believe this would probably work well enough:
> ---
>  scripts/checkpatch.pl | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7be93c3df2bcb..fe25642d8bacc 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3336,7 +3336,8 @@ sub process {
>                 }
>
>  # Check for mailing list archives other than lore.kernel.org
> -               if ($rawline =~ m{\b$obsolete_archives}) {
> +               if ($rawline =~ m{\b$obsolete_archives} &&
> +                   $rawline !~ /^\s*cc:/i) {

Can we make this (to|cc): instead? Otherwise developers (like me) who
use custom scripts to add To: headers to their patches before passing
them to checkpatch.pl will also hit this warning if their patch is
being sent To: one of these mailing lists.

Peter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-11-04  1:07 ` Peter Collingbourne
@ 2022-11-04  1:27   ` Joe Perches
  2022-11-04  1:34     ` Peter Collingbourne
  0 siblings, 1 reply; 19+ messages in thread
From: Joe Perches @ 2022-11-04  1:27 UTC (permalink / raw)
  To: Peter Collingbourne, Bjorn Helgaas, Andrew Morton
  Cc: Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Kees Cook,
	Randy Dunlap, linux-kernel, Bjorn Helgaas

On Thu, 2022-11-03 at 18:07 -0700, Peter Collingbourne wrote:
> On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > as lore.kernel.org because they use different styles, add advertising, and
> > may disappear in the future.  The lore archives are more consistent and
> > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > they exist.
> 
> If the commit message contains a line like:
> 
> Cc: linux-arm-kernel@lists.infradead.org
> 
> this patch causes checkpatch.pl to complain. Would it be possible to
> restrict this to URLs?

Yes, I believe this would probably work well enough:
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7be93c3df2bcb..fe25642d8bacc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3336,7 +3336,8 @@ sub process {
 		}
 
 # Check for mailing list archives other than lore.kernel.org
-		if ($rawline =~ m{\b$obsolete_archives}) {
+		if ($rawline =~ m{\b$obsolete_archives} &&
+		    $rawline !~ /^\s*cc:/i) {
 			WARN("PREFER_LORE_ARCHIVE",
 			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
 		}


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-10-19 20:28 Bjorn Helgaas
  2022-10-19 21:12 ` Joe Perches
@ 2022-11-04  1:07 ` Peter Collingbourne
  2022-11-04  1:27   ` Joe Perches
  1 sibling, 1 reply; 19+ messages in thread
From: Peter Collingbourne @ 2022-11-04  1:07 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn,
	Kees Cook, Randy Dunlap, linux-kernel, Bjorn Helgaas

On Wed, Oct 19, 2022 at 03:28:43PM -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> as lore.kernel.org because they use different styles, add advertising, and
> may disappear in the future.  The lore archives are more consistent and
> more likely to stick around, so prefer https://lore.kernel.org URLs when
> they exist.

If the commit message contains a line like:

Cc: linux-arm-kernel@lists.infradead.org

this patch causes checkpatch.pl to complain. Would it be possible to
restrict this to URLs?

Peter

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-10-19 20:28 Bjorn Helgaas
@ 2022-10-19 21:12 ` Joe Perches
  2022-11-04  1:07 ` Peter Collingbourne
  1 sibling, 0 replies; 19+ messages in thread
From: Joe Perches @ 2022-10-19 21:12 UTC (permalink / raw)
  To: Bjorn Helgaas, Andy Whitcroft, Andrew Morton
  Cc: Dwaipayan Ray, Lukas Bulwahn, Kees Cook, Randy Dunlap,
	linux-kernel, Bjorn Helgaas

On Wed, 2022-10-19 at 15:28 -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> as lore.kernel.org because they use different styles, add advertising, and
> may disappear in the future.  The lore archives are more consistent and
> more likely to stick around, so prefer https://lore.kernel.org URLs when
> they exist.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Seems sensible, thanks.

> ---
> 
> Sample commits for testing with "checkpatch -g":
> 
>   bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
>   fdec2a9ef853 www.spinics.net/lists/kvm-arm
>   1cdca16c043a www.spinics.net/lists/linux-mmc
>   48ea02184a9d www.spinics.net/lists/linux-pci
>   f32ae8a5f131 www.spinics.net/lists/netdev
>   b7dca6dd1e59 lkml.org
>   265df32eae58 lkml.org/lkml/
>   4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
>   c03914b7aa31 marc.info/?l=linux-mm
>   f108c887d089 marc.info/?l=linux-netdev
>   7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
>   dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
>   b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
>   5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
>   3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
>   a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
> 
> Previously posted:
>   https://lore.kernel.org/all/20201217235615.43328-1-helgaas@kernel.org/
>   https://lore.kernel.org/all/20220401201417.126664-1-helgaas@kernel.org/
> ---
>  scripts/checkpatch.pl | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 1e5e66ae5a52..4e187202e77a 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -702,6 +702,17 @@ sub find_standard_signature {
>  	return "";
>  }
>  
> +our $obsolete_archives = qr{(?xi:
> +	\Qfreedesktop.org/archives/dri-devel\E |
> +	\Qlists.infradead.org\E |
> +	\Qlkml.org\E |
> +	\Qmail-archive.com\E |
> +	\Qmailman.alsa-project.org/pipermail\E |
> +	\Qmarc.info\E |
> +	\Qozlabs.org/pipermail\E |
> +	\Qspinics.net\E
> +)};
> +
>  our @typeListMisordered = (
>  	qr{char\s+(?:un)?signed},
>  	qr{int\s+(?:(?:un)?signed\s+)?short\s},
> @@ -3324,6 +3335,12 @@ sub process {
>  			$last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
>  		}
>  
> +# Check for mailing list archives other than lore.kernel.org
> +		if ($rawline =~ m{\b$obsolete_archives}) {
> +			WARN("PREFER_LORE_ARCHIVE",
> +			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
> +		}
> +
>  # Check for added, moved or deleted files
>  		if (!$reported_maintainer_file && !$in_commit_log &&
>  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] checkpatch: add warning for non-lore mailing list URLs
@ 2022-10-19 20:28 Bjorn Helgaas
  2022-10-19 21:12 ` Joe Perches
  2022-11-04  1:07 ` Peter Collingbourne
  0 siblings, 2 replies; 19+ messages in thread
From: Bjorn Helgaas @ 2022-10-19 20:28 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches
  Cc: Dwaipayan Ray, Lukas Bulwahn, Kees Cook, Randy Dunlap,
	linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
as lore.kernel.org because they use different styles, add advertising, and
may disappear in the future.  The lore archives are more consistent and
more likely to stick around, so prefer https://lore.kernel.org URLs when
they exist.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---

Sample commits for testing with "checkpatch -g":

  bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
  fdec2a9ef853 www.spinics.net/lists/kvm-arm
  1cdca16c043a www.spinics.net/lists/linux-mmc
  48ea02184a9d www.spinics.net/lists/linux-pci
  f32ae8a5f131 www.spinics.net/lists/netdev
  b7dca6dd1e59 lkml.org
  265df32eae58 lkml.org/lkml/
  4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
  c03914b7aa31 marc.info/?l=linux-mm
  f108c887d089 marc.info/?l=linux-netdev
  7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
  dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
  b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
  5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
  3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
  a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html

Previously posted:
  https://lore.kernel.org/all/20201217235615.43328-1-helgaas@kernel.org/
  https://lore.kernel.org/all/20220401201417.126664-1-helgaas@kernel.org/
---
 scripts/checkpatch.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1e5e66ae5a52..4e187202e77a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -702,6 +702,17 @@ sub find_standard_signature {
 	return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+	\Qfreedesktop.org/archives/dri-devel\E |
+	\Qlists.infradead.org\E |
+	\Qlkml.org\E |
+	\Qmail-archive.com\E |
+	\Qmailman.alsa-project.org/pipermail\E |
+	\Qmarc.info\E |
+	\Qozlabs.org/pipermail\E |
+	\Qspinics.net\E
+)};
+
 our @typeListMisordered = (
 	qr{char\s+(?:un)?signed},
 	qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3324,6 +3335,12 @@ sub process {
 			$last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
 		}
 
+# Check for mailing list archives other than lore.kernel.org
+		if ($rawline =~ m{\b$obsolete_archives}) {
+			WARN("PREFER_LORE_ARCHIVE",
+			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
+		}
+
 # Check for added, moved or deleted files
 		if (!$reported_maintainer_file && !$in_commit_log &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-04-01 21:26   ` Bjorn Helgaas
@ 2022-04-02  8:00     ` Kalle Valo
  0 siblings, 0 replies; 19+ messages in thread
From: Kalle Valo @ 2022-04-02  8:00 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Randy Dunlap, Andy Whitcroft, Joe Perches, Kees Cook,
	linux-kernel, Bjorn Helgaas, David Woodhouse,
	Konstantin Ryabitsev, David Howells, Marc Dionne

Bjorn Helgaas <helgaas@kernel.org> writes:

> [+cc David, Marc for possibly archiving linux-afs on lore]
>
> On Fri, Apr 01, 2022 at 01:50:12PM -0700, Randy Dunlap wrote:
>
>> There seem to be some mailing lists from lists.infradead.org that are not (yet?)
>> archived on lore.
>> Is there a plan to add more list archives from infradead to lore?
>
> Good question.  I don't know how to find out what things are hosted at
> infradead (it redirects to https://lists.openwrt.org/mailman/listinfo),
> but in the linux git history, I found URLs for these lists that are
> not on lore:
>
>   barebox             1 link from 2014
>   kexec               5 links, most recent from 2021
>   lede-commits        1 link from 2017
>   linux-afs          16 links, most recent 2021
>   linux-parport       1 link from 2005
>   linux-pcmcia        6 links, most recent 2010
>   linux-rpi-kernel    1 link from 2019
>   linux-um            1 link from 2020
>
> linux-afs looks like a good candidate for lore.  Possibly kexec, too.
>
> linux-rpi-kernel seems like it might be of interest and
> https://lists.infradead.org/pipermail/linux-rpi-kernel/ still shows
> some activity.  Unfortunately the only URL I see in the git logs
> (http://lists.infradead.org/pipermail/linux-rpi-kernel/2019-March/008615.html)
> is already dead.
>
> The following infradead lists appear to be archived on lore already:
>
>   ath10k
>   b43-dev
>   linux-amlogic
>   linux-arm-kernel
>   linux-mediatek
>   linux-mtd
>   linux-nvme
>   linux-riscv
>   linux-snps-arc

FWIW, ath11k list is also archived on lore. Thanks to your suggestion :)

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-04-01 20:50 ` Randy Dunlap
@ 2022-04-01 21:26   ` Bjorn Helgaas
  2022-04-02  8:00     ` Kalle Valo
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2022-04-01 21:26 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andy Whitcroft, Joe Perches, Kees Cook, linux-kernel,
	Bjorn Helgaas, David Woodhouse, Konstantin Ryabitsev,
	David Howells, Marc Dionne

[+cc David, Marc for possibly archiving linux-afs on lore]

On Fri, Apr 01, 2022 at 01:50:12PM -0700, Randy Dunlap wrote:
> On 4/1/22 13:14, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> > as lore.kernel.org because they use different styles, add advertising, and
> > may disappear in the future.  The lore archives are more consistent and
> > more likely to stick around, so prefer https://lore.kernel.org URLs when
> > they exist.
> > 
> > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> > 
> > Thanks to Joe for fixing the quoting:
> > https://lore.kernel.org/all/3e21b6e87e219d6538a193a9021b965fd8180025.camel@perches.com/
> > Sorry I totally dropped the ball -- I guess I was scared off by fixing the
> > perl quoting and didn't notice that you actually did it for me ;)
> > 
> > Sample commits for testing with "checkpatch -g":
> > 
> >   bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
> >   fdec2a9ef853 www.spinics.net/lists/kvm-arm
> >   1cdca16c043a www.spinics.net/lists/linux-mmc
> >   48ea02184a9d www.spinics.net/lists/linux-pci
> >   f32ae8a5f131 www.spinics.net/lists/netdev
> >   b7dca6dd1e59 lkml.org
> >   265df32eae58 lkml.org/lkml/
> >   4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
> >   c03914b7aa31 marc.info/?l=linux-mm
> >   f108c887d089 marc.info/?l=linux-netdev
> >   7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
> >   dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
> >   b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
> >   5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
> >   3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
> >   a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
> > ---
> >  scripts/checkpatch.pl | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 577e02998701..819e0dece5e9 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -698,6 +698,17 @@ sub find_standard_signature {
> >  	return "";
> >  }
> >  
> > +our $obsolete_archives = qr{(?xi:
> > +	\Qfreedesktop.org/archives/dri-devel\E |
> > +	\Qlists.infradead.org\E |
> > +	\Qlkml.org\E |
> > +	\Qmail-archive.com\E |
> > +	\Qmailman.alsa-project.org/pipermail\E |
> > +	\Qmarc.info\E |
> > +	\Qozlabs.org/pipermail\E |
> > +	\Qspinics.net\E
> > +)};
> 
> Hi,
> 
> There seem to be some mailing lists from lists.infradead.org that are not (yet?)
> archived on lore.
> Is there a plan to add more list archives from infradead to lore?

Good question.  I don't know how to find out what things are hosted at
infradead (it redirects to https://lists.openwrt.org/mailman/listinfo),
but in the linux git history, I found URLs for these lists that are
not on lore:

  barebox             1 link from 2014
  kexec               5 links, most recent from 2021
  lede-commits        1 link from 2017
  linux-afs          16 links, most recent 2021
  linux-parport       1 link from 2005
  linux-pcmcia        6 links, most recent 2010
  linux-rpi-kernel    1 link from 2019
  linux-um            1 link from 2020

linux-afs looks like a good candidate for lore.  Possibly kexec, too.

linux-rpi-kernel seems like it might be of interest and
https://lists.infradead.org/pipermail/linux-rpi-kernel/ still shows
some activity.  Unfortunately the only URL I see in the git logs
(http://lists.infradead.org/pipermail/linux-rpi-kernel/2019-March/008615.html)
is already dead.

The following infradead lists appear to be archived on lore already:

  ath10k
  b43-dev
  linux-amlogic
  linux-arm-kernel
  linux-mediatek
  linux-mtd
  linux-nvme
  linux-riscv
  linux-snps-arc

> > +
> >  our @typeListMisordered = (
> >  	qr{char\s+(?:un)?signed},
> >  	qr{int\s+(?:(?:un)?signed\s+)?short\s},
> > @@ -3273,6 +3284,12 @@ sub process {
> >  			$last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
> >  		}
> >  
> > +# Check for mailing list archives other than lore.kernel.org
> > +		if ($rawline =~ m{\b$obsolete_archives}) {
> > +			WARN("PREFER_LORE_ARCHIVE",
> > +			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
> > +		}
> > +
> >  # Check for added, moved or deleted files
> >  		if (!$reported_maintainer_file && !$in_commit_log &&
> >  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
> 
> -- 
> ~Randy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] checkpatch: add warning for non-lore mailing list URLs
  2022-04-01 20:14 Bjorn Helgaas
@ 2022-04-01 20:50 ` Randy Dunlap
  2022-04-01 21:26   ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Randy Dunlap @ 2022-04-01 20:50 UTC (permalink / raw)
  To: Bjorn Helgaas, Andy Whitcroft, Joe Perches
  Cc: Kees Cook, linux-kernel, Bjorn Helgaas, David Woodhouse,
	Konstantin Ryabitsev



On 4/1/22 13:14, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
> as lore.kernel.org because they use different styles, add advertising, and
> may disappear in the future.  The lore archives are more consistent and
> more likely to stick around, so prefer https://lore.kernel.org URLs when
> they exist.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> 
> Thanks to Joe for fixing the quoting:
> https://lore.kernel.org/all/3e21b6e87e219d6538a193a9021b965fd8180025.camel@perches.com/
> Sorry I totally dropped the ball -- I guess I was scared off by fixing the
> perl quoting and didn't notice that you actually did it for me ;)
> 
> Sample commits for testing with "checkpatch -g":
> 
>   bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
>   fdec2a9ef853 www.spinics.net/lists/kvm-arm
>   1cdca16c043a www.spinics.net/lists/linux-mmc
>   48ea02184a9d www.spinics.net/lists/linux-pci
>   f32ae8a5f131 www.spinics.net/lists/netdev
>   b7dca6dd1e59 lkml.org
>   265df32eae58 lkml.org/lkml/
>   4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
>   c03914b7aa31 marc.info/?l=linux-mm
>   f108c887d089 marc.info/?l=linux-netdev
>   7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
>   dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
>   b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
>   5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
>   3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
>   a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
> ---
>  scripts/checkpatch.pl | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 577e02998701..819e0dece5e9 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -698,6 +698,17 @@ sub find_standard_signature {
>  	return "";
>  }
>  
> +our $obsolete_archives = qr{(?xi:
> +	\Qfreedesktop.org/archives/dri-devel\E |
> +	\Qlists.infradead.org\E |
> +	\Qlkml.org\E |
> +	\Qmail-archive.com\E |
> +	\Qmailman.alsa-project.org/pipermail\E |
> +	\Qmarc.info\E |
> +	\Qozlabs.org/pipermail\E |
> +	\Qspinics.net\E
> +)};

Hi,

There seem to be some mailing lists from lists.infradead.org that are not (yet?)
archived on lore.
Is there a plan to add more list archives from infradead to lore?

thanks.

> +
>  our @typeListMisordered = (
>  	qr{char\s+(?:un)?signed},
>  	qr{int\s+(?:(?:un)?signed\s+)?short\s},
> @@ -3273,6 +3284,12 @@ sub process {
>  			$last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
>  		}
>  
> +# Check for mailing list archives other than lore.kernel.org
> +		if ($rawline =~ m{\b$obsolete_archives}) {
> +			WARN("PREFER_LORE_ARCHIVE",
> +			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
> +		}
> +
>  # Check for added, moved or deleted files
>  		if (!$reported_maintainer_file && !$in_commit_log &&
>  		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||

-- 
~Randy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] checkpatch: add warning for non-lore mailing list URLs
@ 2022-04-01 20:14 Bjorn Helgaas
  2022-04-01 20:50 ` Randy Dunlap
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2022-04-01 20:14 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: Kees Cook, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

The lkml.org, marc.info, spinics.net, etc archives are not quite as useful
as lore.kernel.org because they use different styles, add advertising, and
may disappear in the future.  The lore archives are more consistent and
more likely to stick around, so prefer https://lore.kernel.org URLs when
they exist.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---

Thanks to Joe for fixing the quoting:
https://lore.kernel.org/all/3e21b6e87e219d6538a193a9021b965fd8180025.camel@perches.com/
Sorry I totally dropped the ball -- I guess I was scared off by fixing the
perl quoting and didn't notice that you actually did it for me ;)

Sample commits for testing with "checkpatch -g":

  bd82d4bd2188 www.spinics.net/lists/arm-kernel/msg716956.html
  fdec2a9ef853 www.spinics.net/lists/kvm-arm
  1cdca16c043a www.spinics.net/lists/linux-mmc
  48ea02184a9d www.spinics.net/lists/linux-pci
  f32ae8a5f131 www.spinics.net/lists/netdev
  b7dca6dd1e59 lkml.org
  265df32eae58 lkml.org/lkml/
  4a9ceb7dbadf marc.info/?l=linux-kernel&m=155656897409107&w=2.
  c03914b7aa31 marc.info/?l=linux-mm
  f108c887d089 marc.info/?l=linux-netdev
  7424edbb5590 marc.info/?t=156200975600004&r=1&w=2
  dabac6e460ce https://marc.info/?l=linux-rdma&m=152296522708522&w=2
  b02f6a2ef0a1 www.mail-archive.com/linux-kernel@vger.kernel.org
  5e91bf5ce9b8 lists.infradead.org/pipermail/linux-snps-arc/2019-May
  3cde818cd02b mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
  a5448fdc469d http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html
---
 scripts/checkpatch.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 577e02998701..819e0dece5e9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -698,6 +698,17 @@ sub find_standard_signature {
 	return "";
 }
 
+our $obsolete_archives = qr{(?xi:
+	\Qfreedesktop.org/archives/dri-devel\E |
+	\Qlists.infradead.org\E |
+	\Qlkml.org\E |
+	\Qmail-archive.com\E |
+	\Qmailman.alsa-project.org/pipermail\E |
+	\Qmarc.info\E |
+	\Qozlabs.org/pipermail\E |
+	\Qspinics.net\E
+)};
+
 our @typeListMisordered = (
 	qr{char\s+(?:un)?signed},
 	qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3273,6 +3284,12 @@ sub process {
 			$last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i);
 		}
 
+# Check for mailing list archives other than lore.kernel.org
+		if ($rawline =~ m{\b$obsolete_archives}) {
+			WARN("PREFER_LORE_ARCHIVE",
+			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
+		}
+
 # Check for added, moved or deleted files
 		if (!$reported_maintainer_file && !$in_commit_log &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-11-14 22:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 23:56 [PATCH] checkpatch: add warning for non-lore mailing list URLs Bjorn Helgaas
2020-12-18  0:50 ` Joe Perches
2021-02-10  8:22   ` Kees Cook
2021-02-10 17:45     ` Bjorn Helgaas
2022-04-01 20:14 Bjorn Helgaas
2022-04-01 20:50 ` Randy Dunlap
2022-04-01 21:26   ` Bjorn Helgaas
2022-04-02  8:00     ` Kalle Valo
2022-10-19 20:28 Bjorn Helgaas
2022-10-19 21:12 ` Joe Perches
2022-11-04  1:07 ` Peter Collingbourne
2022-11-04  1:27   ` Joe Perches
2022-11-04  1:34     ` Peter Collingbourne
2022-11-04  1:40       ` Joe Perches
2022-11-04 16:49         ` Peter Collingbourne
2022-11-07 20:54       ` Bjorn Helgaas
2022-11-07 21:00         ` Peter Collingbourne
2022-11-14 22:43           ` Bjorn Helgaas
2022-11-14 22:50             ` Peter Collingbourne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).