Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1553647rwb; Thu, 8 Dec 2022 12:08:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7mqubpDZmFuUUu5vyxM+vQBN9etqZyRoXN74W/Oo9KXNFwFza6hftEvBHb7PiD/NVu36FT X-Received: by 2002:a63:c14e:0:b0:470:4f30:6d80 with SMTP id p14-20020a63c14e000000b004704f306d80mr75181369pgi.285.1670530104697; Thu, 08 Dec 2022 12:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670530104; cv=none; d=google.com; s=arc-20160816; b=wqF5EnUD2gHX53JaiZgGCg+IHvDr2IVrT562wRGSkuxF2eQL+9jwD6KphaxZkkb3cF QaKHAcUIyaeK0wqJ2SzAa5La+7ulsDzn1rTtMe2Zds17jV02AGDFkONvmC0s15ftzhwn 45ooSOVFH+s/piCwOfxt9DBs/4QemeoP1lpIcLN/h73ikMByy6EQAUIs4IczabBaZkhw 0o+Mqw0AeA0tezSu22+UI1NlBGbJ3Mlc47TkQRhXJsExCTaWXtE7ohBN9B/AdhG0Q3s4 JbCs2kDqrtadA2GIg6hh1d4/3wIAoVa8qv0Ybt/3R2vPcYAcHXYodz6frAAsVcL9h4cI Fsbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0mor0qRgMSexi+Svc4qbLrbbNQjNDx3UIYMb4IVtbGQ=; b=pFSv5bazAGRCXAsxWZ67plRT+D/3k83NJDRe/6/U8SbdQJCpMJaNf55m5CKi/r9RGv ttNi7PlLcYCEu/wK5x0LhNh4iB4bICqz+NsILtIp93ndPqJZKWP3V55gXPw2u7rI59QV 7Ma70BDzAsse1aUwPjaYqes68nmE4filhz0Q9xyNCoN1/+zmyICbrhH7o4VlBg/maACv macXbtskBAEyMTuNMQrzlCaa6JLSGZyVr1Mv9Eebc24DtiCpYHcVcGPKrWgPIwTXaDQp hKo9Oncf7RfQVAofZfnIEZYRxUIAlEnMytW0zCdOALWBhuY6FPIl3tIHFYvNbwFa74TY ychg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay10-20020a1709028b8a00b0018946b0b641si22970875plb.371.2022.12.08.12.08.14; Thu, 08 Dec 2022 12:08:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbiLHTdC (ORCPT + 73 others); Thu, 8 Dec 2022 14:33:02 -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: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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=email -P --grep='^\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-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/15f7df96d49082fb7799dda6e187b33c84f38831.camel@perches.com/ [2] Signed-off-by: Kai Wasserbäch Co-developed-by: Thorsten Leemhuis Signed-off-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 = 0; } +# Check for odd tags before a URI/URL + if ($in_commit_log && + $line =~ /^\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 =~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL", -- 2.35.1