From nobody Fri Apr 17 15:32:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08D28C4332F for ; Thu, 8 Dec 2022 19:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbiLHTdD (ORCPT ); Thu, 8 Dec 2022 14:33:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiLHTcz (ORCPT ); Thu, 8 Dec 2022 14:32:55 -0500 Received: from blackmesa.kw-serverwartung.de (blackmesa.kw-serverwartung.de [78.46.90.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0FB36C4C for ; Thu, 8 Dec 2022 11:32:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blackmesa.kw-serverwartung.de (Postfix) with ESMTP id E81787B81BE; Thu, 8 Dec 2022 19:32:50 +0000 (UTC) Received: from blackmesa.kw-serverwartung.de ([127.0.0.1]) by localhost (blackmesa.kw-serverwartung.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 60jFDUbe9VS7; Thu, 8 Dec 2022 19:32:48 +0000 (UTC) Received: from citadel.fritz.box (i59F4DED6.versanet.de [89.244.222.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by blackmesa.kw-serverwartung.de (Postfix) with ESMTPSA id 355F07B8099; Thu, 8 Dec 2022 19:32:48 +0000 (UTC) From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= To: linux-kernel@vger.kernel.org Cc: Thorsten Leemhuis , Andrew Morton , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 1/2] checkpatch: warn when unknown tags are used for links Date: Thu, 8 Dec 2022 20:32:45 +0100 Message-Id: <869badb999d4021dd6efd792f53fc2859257c350.1670527774.git.kai@dev.carbon-project.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Issue a warning when encountering URLs behind unknown tags, as Linus recently stated ```please stop making up random tags that make no sense. Just use "Link:"```[1]. That statement was triggered by an use of 'BugLink', but that's not the only tag people invented: $ git log -100000 --format=3Demail -P --grep=3D'^\w+:[ \t]*http' | \ grep -Poh '^\w+:[ \t]*http' | \ sort | uniq -c | sort -rn | head -n 20 103889 Link: http 415 BugLink: http 372 Patchwork: http 270 Closes: http 221 Bug: http 121 References: http 101 v1: http 77 Bugzilla: http 60 URL: http 59 v2: http 37 Datasheet: http 35 v3: http 19 v4: http 12 v5: http 9 Ref: http 9 Fixes: http 9 Buglink: http 8 v6: http 8 Reference: http 7 V1: http Some of these non-standard tags make it harder for external tools that rely on use of proper tags. One of those tools is the regression tracking bot 'regzbot', which looks out for "Link:" tags pointing to reports of tracked regressions. The initial idea was to use a disallow list to raise an error when encountering known unwanted tags like BugLink:; during review it was requested to use a list of allowed tags instead[2]. Link: https://lore.kernel.org/all/CAHk-=3Dwgs38ZrfPvy=3DnOwVkVzjpM3VFU1zobP= 37Fwd_h9iAD5JQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/15f7df96d49082fb7799dda6e187b33c84f38831.= camel@perches.com/ [2] Signed-off-by: Kai Wasserb=C3=A4ch Co-developed-by: Thorsten Leemhuis Signed-off-by: Thorsten Leemhuis Suggested-by: Thorsten Leemhuis --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a..f2f997f487 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3239,6 +3239,13 @@ sub process { $commit_log_possible_stack_dump =3D 0; } =20 +# Check for odd tags before a URI/URL + if ($in_commit_log && + $line =3D~ /^\s*(\w+):\s*http/ && $1 !~ /^Link/) { + WARN("COMMIT_LOG_USE_LINK", + "Unknown link reference '$1:', use 'Link:' instead.\n" . $herecurr= ); + } + # Check for lines starting with a # if ($in_commit_log && $line =3D~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL", --=20 2.35.1 From nobody Fri Apr 17 15:32:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DAC0C4332F for ; Sun, 4 Dec 2022 11:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbiLDLja (ORCPT ); Sun, 4 Dec 2022 06:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbiLDLjC (ORCPT ); Sun, 4 Dec 2022 06:39:02 -0500 X-Greylist: delayed 309 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 04 Dec 2022 03:38:59 PST Received: from blackmesa.kw-serverwartung.de (blackmesa.kw-serverwartung.de [78.46.90.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9057C18353 for ; Sun, 4 Dec 2022 03:38:59 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blackmesa.kw-serverwartung.de (Postfix) with ESMTP id B5D127B80BE; Sun, 4 Dec 2022 11:33:47 +0000 (UTC) Received: from blackmesa.kw-serverwartung.de ([127.0.0.1]) by localhost (blackmesa.kw-serverwartung.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DsZqioH_2RIr; Sun, 4 Dec 2022 11:33:45 +0000 (UTC) Received: from citadel.fritz.box (i5C74630E.versanet.de [92.116.99.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by blackmesa.kw-serverwartung.de (Postfix) with ESMTPSA id 410137B81BA; Sun, 4 Dec 2022 11:33:45 +0000 (UTC) From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Thorsten Leemhuis Subject: [PATCH 1/2] feat: checkpatch: error on usage of a Buglink tag in the commit log Date: Sun, 4 Dec 2022 12:33:38 +0100 Message-Id: <66fc52aadd45f0c4178fbc6063615fee163b5a3f.1670152844.git.kai@dev.carbon-project.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Suggested-by: Thorsten Leemhuis Signed-off-by: Kai Wasserb=C3=A4ch --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a..a6d2ccaa3e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3248,6 +3248,12 @@ sub process { } } =20 +# check if Bug[lL]ink: or Bugzilla: is used and error + if ($in_commit_log && $line =3D~ /^\s*(buglink|bugzilla):\s*(.*)/i) { + ERROR("COMMIT_LOG_BAD_BUGLINK", + "Non-standard tag '" . $1 . "' - use 'Link:' instead!\n" . $herecurr); + } + # Check for git id commit length and improperly formed commit descriptions # A correctly formed commit description is: # commit ("Complete commit subject") --=20 2.35.1 From nobody Fri Apr 17 15:32:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90A49C4332F for ; Thu, 8 Dec 2022 19:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiLHTdM (ORCPT ); Thu, 8 Dec 2022 14:33:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiLHTcz (ORCPT ); Thu, 8 Dec 2022 14:32:55 -0500 Received: from blackmesa.kw-serverwartung.de (blackmesa.kw-serverwartung.de [78.46.90.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A293722E for ; Thu, 8 Dec 2022 11:32:53 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blackmesa.kw-serverwartung.de (Postfix) with ESMTP id E44B27B8099; Thu, 8 Dec 2022 19:32:51 +0000 (UTC) Received: from blackmesa.kw-serverwartung.de ([127.0.0.1]) by localhost (blackmesa.kw-serverwartung.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U3bU109iuLOH; Thu, 8 Dec 2022 19:32:48 +0000 (UTC) Received: from citadel.fritz.box (i59F4DED6.versanet.de [89.244.222.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by blackmesa.kw-serverwartung.de (Postfix) with ESMTPSA id 856CA7B81B9; Thu, 8 Dec 2022 19:32:48 +0000 (UTC) From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= To: linux-kernel@vger.kernel.org Cc: Thorsten Leemhuis , Andrew Morton , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 2/2] checkpatch: warn when Reported-by: is not followed by Link: Date: Thu, 8 Dec 2022 20:32:46 +0100 Message-Id: <4af6cd7f0833f18e9eee8caba1913e682c5ec071.1670527774.git.kai@dev.carbon-project.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > > 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-=3DwjMmSZzMJ3Xnskdg4+GGz=3D5p5p+GSYy= FBTh0f-DgvdBWg@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/CAHk-=3Dwgs38ZrfPvy=3DnOwVkVzjpM3VFU1zobP= 37Fwd_h9iAD5JQ@mail.gmail.com/ [2] Link: https://lore.kernel.org/all/CAHk-=3DwjxzafG-=3DJ8oT30s7upn4RhBs6TX-uV= FZ5rME+L5_DoJA@mail.gmail.com/ [3] Signed-off-by: Kai Wasserb=C3=A4ch Co-developed-by: Thorsten Leemhuis Signed-off-by: Thorsten Leemhuis Reported-by:, it appears that "Fixes:" should also be allowed. Suggested-by: Thorsten Leemhuis --- scripts/checkpatch.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f2f997f487..d4547c5fd4 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3144,6 +3144,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 =3D~ /^reported-by:$/i) { + if (!defined $lines[$linenr]) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Link: to the rep= ort\n" . "$here\n" . $rawline); + } elsif ($rawlines[$linenr] !~ /^\s*link:\s*(.*)/i) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: should be immediately followed by Link: to the rep= ort\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } elsif ($lines[$linenr] !~ /https?:\/\//i) { + WARN("BAD_REPORTED_BY_LINK", + "Link: following Reported-by: should contain an URL\n" . "$here\= n" . $rawline . "\n" .$rawlines[$linenr]); + } + } } =20 # Check Fixes: styles is correct --=20 2.35.1 From nobody Fri Apr 17 15:32:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02767C4332F for ; Sun, 4 Dec 2022 11:39:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbiLDLjZ (ORCPT ); Sun, 4 Dec 2022 06:39:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiLDLjC (ORCPT ); Sun, 4 Dec 2022 06:39:02 -0500 Received: from blackmesa.kw-serverwartung.de (blackmesa.kw-serverwartung.de [78.46.90.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A051E1838A for ; Sun, 4 Dec 2022 03:38:59 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blackmesa.kw-serverwartung.de (Postfix) with ESMTP id A55107B81E4; Sun, 4 Dec 2022 11:33:49 +0000 (UTC) Received: from blackmesa.kw-serverwartung.de ([127.0.0.1]) by localhost (blackmesa.kw-serverwartung.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KInPBbexaMGr; Sun, 4 Dec 2022 11:33:47 +0000 (UTC) Received: from citadel.fritz.box (i5C74630E.versanet.de [92.116.99.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by blackmesa.kw-serverwartung.de (Postfix) with ESMTPSA id 6C9457B81BF; Sun, 4 Dec 2022 11:33:45 +0000 (UTC) From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Thorsten Leemhuis Subject: [PATCH 2/2] feat: checkpatch: Warn about Reported-by: not being followed by a Link: Date: Sun, 4 Dec 2022 12:33:39 +0100 Message-Id: <721266a0e453bdebf9dc9b4a5fb5482f278fb7d0.1670152844.git.kai@dev.carbon-project.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Suggested-by: Thorsten Leemhuis Signed-off-by: Kai Wasserb=C3=A4ch --- scripts/checkpatch.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a6d2ccaa3e..d957e9fddf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3144,6 +3144,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 =3D~ /^reported-by:$/i) { + if (!defined $lines[$linenr]) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: must be immediately followed by Link:\n" . "$here\= n" . $rawline); + } elsif ($rawlines[$linenr] !~ /^\s*link:\s*(.*)/i) { + WARN("BAD_REPORTED_BY_LINK", + "Reported-by: must be immediately followed by Link:\n" . "$here\= n" . $rawline . "\n" .$rawlines[$linenr]); + } elsif ($lines[$linenr] !~ /https?:\/\//i) { + WARN("BAD_REPORTED_BY_LINK", + "Link: following Reported-by: should contain an URL\n" . "$here\= n" . $rawline . "\n" .$rawlines[$linenr]); + } + } } =20 # Check Fixes: styles is correct --=20 2.35.1