mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Leemhuis <linux@leemhuis.info>
To: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: "Kai Wasserbäch" <kai@dev.carbon-project.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/3] checkpatch: warn when Reported-by: is not followed by Link:
Date: Fri, 20 Jan 2023 13:35:19 +0100	[thread overview]
Message-ID: <bb5dfd55ea2026303ab2296f4a6df3da7dd64006.1674217480.git.linux@leemhuis.info> (raw)
In-Reply-To: <cover.1674217480.git.linux@leemhuis.info>

From: Kai Wasserbäch <kai@dev.carbon-project.org>

Encourage patch authors to link to reports by issuing a warning, if
a Reported-by: is not accompanied by a link to the report. Those links
are often extremely useful for any code archaeologist that wants to know
more about the backstory of a change than the commit message provides.
That includes maintainers higher up in the patch-flow hierarchy, which
is why Linus asks developers to add such links [1, 2, 3]. To quote [1]:

> Again, the commit has a link to the patch *submission*, which is
> almost entirely useless. There's no link to the actual problem the
> patch fixes.
>
> [...]
>
> Put another way: I can see that
>
> Reported-by: Zhangfei Gao <zhangfei.gao@foxmail.com>
>
> in the commit, but I don't have a clue what the actual report was, and
> there really isn't enough information in the commit itself, except for
> a fairly handwavy "Device drivers might, for instance, still need to
> flush operations.."
>
> I don't want to know what device drivers _might_ do. I would want to
> have an actual pointer to what they do and where.

Another reason why these links are wanted: the ongoing regression
tracking efforts can only scale with them, as they allow the regression
tracking bot 'regzbot' to automatically connect tracked reports with
patches that are posted or committed to fix tracked regressions.

Link: https://lore.kernel.org/all/CAHk-=wjMmSZzMJ3Xnskdg4+GGz=5p5p+GSYyFBTh0f-DgvdBWg@mail.gmail.com/ [1]
Link: https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [2]
Link: https://lore.kernel.org/all/CAHk-=wjxzafG-=J8oT30s7upn4RhBs6TX-uVFZ5rME+L5_DoJA@mail.gmail.com/ [3]
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Co-developed-by: Thorsten Leemhuis <linux@leemhuis.info>
Signed-off-by: Thorsten Leemhuis <linux@leemhuis.info>
---
 scripts/checkpatch.pl | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d739ce0909b1..b74d6002f773 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3155,8 +3155,20 @@ sub process {
 					     "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]);
 				}
 			}
+
+# check if Reported-by: is followed by a Link:
+			if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) {
+				if (!defined $lines[$linenr]) {
+					WARN("BAD_REPORTED_BY_LINK",
+					     "Reported-by: should be immediately followed by Link: to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
+				} elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) {
+					WARN("BAD_REPORTED_BY_LINK",
+					     "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
+				}
+			}
 		}
 
+
 # Check Fixes: styles is correct
 		if (!$in_header_lines &&
 		    $line =~ /^\s*fixes:?\s*(?:commit\s*)?[0-9a-f]{5,}\b/i) {
-- 
2.39.0


  parent reply	other threads:[~2023-01-20 12:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04 11:33 [PATCH 0/2] feat: checkpatch: prohibit Buglink: and warn about missing Link: Kai Wasserbäch
2022-12-04 11:33 ` [PATCH 1/2] feat: checkpatch: error on usage of a Buglink tag in the commit log Kai Wasserbäch
2022-12-04 11:33 ` [PATCH 2/2] feat: checkpatch: Warn about Reported-by: not being followed by a Link: Kai Wasserbäch
2022-12-08 19:32 ` [PATCH 1/2] checkpatch: warn when unknown tags are used for links Kai Wasserbäch
2022-12-08 19:58   ` Joe Perches
2022-12-09  9:33     ` Thorsten Leemhuis
2022-12-09 16:57       ` Joe Perches
2022-12-08 19:32 ` [PATCH 2/2] checkpatch: warn when Reported-by: is not followed by Link: Kai Wasserbäch
2022-12-08 20:21   ` Joe Perches
2022-12-08 21:11     ` Thorsten Leemhuis
2022-12-08 21:34       ` Joe Perches
2022-12-09  8:33         ` Thorsten Leemhuis
2022-12-09  9:54     ` Thorsten Leemhuis
2022-12-09 17:00       ` Joe Perches
2022-12-15 14:43 ` [PATCH 0/3, v3] feat: checkpatch: warn about dicouraged link tags and missing links Kai Wasserbäch
2022-12-15 14:43   ` [PATCH 1/3] checkpatch: warn when unknown tags are used for links Kai Wasserbäch
2022-12-15 14:43   ` [PATCH 2/3] checkpatch: warn when Reported-by: is not followed by Link: Kai Wasserbäch
2022-12-15 18:00     ` Joe Perches
2022-12-18 14:54       ` Thorsten Leemhuis
2022-12-15 14:43   ` [PATCH 3/3] checkpatch: use proper way for show problematic line Kai Wasserbäch
2023-01-20 12:35 ` [PATCH v4 0/3] checkpatch.pl: warn about discouraged tags and missing Link: tags Thorsten Leemhuis
2023-01-20 12:35   ` [PATCH v4 1/3] checkpatch: warn when unknown tags are used for links Thorsten Leemhuis
2023-02-27 13:25     ` Matthieu Baerts
2023-03-02  5:36       ` Thorsten Leemhuis
2023-01-20 12:35   ` Thorsten Leemhuis [this message]
2023-03-02  4:46     ` [PATCH v4 2/3] checkpatch: warn when Reported-by: is not followed by Link: Jakub Kicinski
2023-03-02  5:17       ` Thorsten Leemhuis
2023-03-02  5:40         ` Jakub Kicinski
2023-03-02  8:27           ` Dmitry Vyukov
2023-03-02  9:04             ` Thorsten Leemhuis
2023-03-02  9:11               ` Dmitry Vyukov
2023-03-02  9:48                 ` Thorsten Leemhuis
2023-03-03  2:10                   ` Andrew Morton
2023-03-06  8:53                     ` Dmitry Vyukov
2023-03-07 11:36                       ` Thorsten Leemhuis
2023-01-20 12:35   ` [PATCH v4 3/3] checkpatch: use proper way for show problematic line Thorsten Leemhuis
2023-01-20 15:20   ` [PATCH v4 0/3] checkpatch.pl: warn about discouraged tags and missing Link: tags Joe Perches

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=bb5dfd55ea2026303ab2296f4a6df3da7dd64006.1674217480.git.linux@leemhuis.info \
    --to=linux@leemhuis.info \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=kai@dev.carbon-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.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

all inboxes | Powered by JetHome®