Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2634080ybz; Sun, 3 May 2020 05:46:45 -0700 (PDT) X-Google-Smtp-Source: APiQypICe7uMGbC8Qt/SQHPrNLgfXzpE6Y/s6S2Pezxcyoly00tyWvgf8q+omjiJBQh5pRv0bYUq X-Received: by 2002:a17:906:57d7:: with SMTP id u23mr10030268ejr.354.1588510005087; Sun, 03 May 2020 05:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588510005; cv=none; d=google.com; s=arc-20160816; b=a4YpRNBVyTiGFnHuCl20/NYR6WRn+8Z9H6c+dqT9pvOQSPcHGUU0id64Y526Evv5EF WmciqH0pCuerQ04KLkhWpSvp7iAFo0LtDRTShgHXEqsh0TRDnlrWLp2483/lPOzTuZk6 vMnShAgu0swh5MZG8QluSaegiv+Laul3bxGYYLl5F0XLwTSTpDFIDJ7ab6hUKINHVoqu l7GPqmL8wvnNP/DpoZXM6ZSzVuNhnZuPTxURKzQ/Psl6+UhN3jVNsEAI3fDKCo0E7gTC dzMhLxBzmHPwfxJ1JWDYrL+TftIdaCjhSpi4qwqfx1UQGo/msHXj/u78nRlyBAFRrhw+ Kd9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=26JhLNWEI7jS5emKz4ATnhzzFH8XDenxaWgLiomlOeY=; b=SNW4j4Gye8x4QQ+arsyHQ5wxrnzZdwIIwCCmbrNCz52wMwqCGZakisJmvajsmi7+P1 u/qYIv47rifv3rs5V2DHLV9wuGWw5eM780u+zQpMVmaaKrvKpqZ1lZvDMOsGABuF4FKh y2XaJTrrvOCiES6Z9QeFSp0C/l5Szy05L+xWwEQBJSsZ31uGh99qq7/Nvl5zwJC0yHhU HBFH/b/9IWWcHxVsPri869Ac2qI/ieW8HdFco2Sc7iijdqBLf9jhkjJlrtMjNgSe6f5y stDhnCdEUaLlnkZsIk9StdHyVQqGzIqK5crBvu9ViCWVfkoOhBRcKeQcbrEfppT/YnNA Myqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YPy9GLl7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si4817874ejq.91.2020.05.03.05.46.22; Sun, 03 May 2020 05:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YPy9GLl7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgECMmD (ORCPT + 99 others); Sun, 3 May 2020 08:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728686AbgECMlj (ORCPT ); Sun, 3 May 2020 08:41:39 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00538C061A0C; Sun, 3 May 2020 05:41:38 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id a7so2421835pju.2; Sun, 03 May 2020 05:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=26JhLNWEI7jS5emKz4ATnhzzFH8XDenxaWgLiomlOeY=; b=YPy9GLl7PeY/VbAy+rtrCYKEMCSd1i+TZOUYQT0HFRKiCdGaXv634BBawJ1e5THmfL eh67Lrdrtv/MaTt5a86VEMk8Uib7dYBnBAPdXzVUnJe/yd00z1evetp6VYrHG/auoNaU +t15IHPPtYI1yhtnXi+16ryuQDqkKZViWFcQHlcjzdomsAkERQ2hBoZIoAFF3XrzcuyF KAX/QRaId8NjW0bs1t5GRLU9e/UfGISY/s4eUE9JArpkKMM9KjNCYQoGW/RaA4Nr4Y1q rjBEIbLHyuWYbIf5vYvTj9nr0bNribrbIFXSWiUinJiIljOppQHGYT3sZsf494+SyRLO 4ROQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=26JhLNWEI7jS5emKz4ATnhzzFH8XDenxaWgLiomlOeY=; b=c2UW2xibCRU4AptGAdbSUGR60kSu5Z1BSRFxQWNnwzP2pg9nEWzInxQM+ZTizeHR2m Dzh/Xf1x4h4FZG4l+IsB1AWinEzMUYfkZxG77ZTDQIb1WmPKpMGDUyEHgri7wkyMBQqv XeHm9EBQZ4UBTWyG0Zrdega1RCA2ypXK56tNe3ciE2O8ZB5MGY9DkqZhDAm838SXqBYY +xlc2WVwD17KMpCdGzvp12W88bTYMpW1CEODk1SzJKSPDtqCPCcki3vTs/HZ/8EHhns/ eXdm/O7Fzh5zdOwkC+DuyG7wEwSnGQVSGH2pQfbXXuNIzetIF/Q9ck1/3qznGov/v4Ph XA+w== X-Gm-Message-State: AGi0PuaTaxRrOkTG92g53YTyq7DlqYYFrXzA3SzvnBg135T0FSMtJIRD o1dk6lnQJzUBEbcPPopON4o= X-Received: by 2002:a17:902:b186:: with SMTP id s6mr14028869plr.16.1588509698515; Sun, 03 May 2020 05:41:38 -0700 (PDT) Received: from udknight.localhost ([59.57.158.27]) by smtp.gmail.com with ESMTPSA id d74sm6512030pfd.70.2020.05.03.05.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2020 05:41:37 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id 043CYZlr011084; Sun, 3 May 2020 20:34:35 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id 043CYZiM011083; Sun, 3 May 2020 20:34:35 +0800 Date: Sun, 3 May 2020 20:34:35 +0800 From: Wang YanQing To: joe@perches.com Cc: Andy Whitcroft , linux-kernel@vger.kernel.org, Alexei Starovoitov , Matteo Croce , Markus.Elfring@web.de, kernel-janitors@vger.kernel.org Subject: [PATCH] checkpatch: add support for title acrosses three lines in commit id description Message-ID: <20200503123435.GD10332@udknight> Mail-Followup-To: Wang YanQing , joe@perches.com, Andy Whitcroft , linux-kernel@vger.kernel.org, Alexei Starovoitov , Matteo Croce , Markus.Elfring@web.de, kernel-janitors@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current GIT_COMMIT_ID will report error when the title in commit id description acrosses three lines, take changelog of commit 87b0f983f66f ("net: mscc: ocelot: fix untagged packet drops when enslaving to vlan aware bridge") as a example. It make senses to support three lines title, because three lines could only have about two lines length title, see above example, but I think we don't need to add support for more than three lines length title, ~225 (75 * 3) shoud be enough for any sensible title. This patch adds support for three lines title in the commit id description, and emit diagnostics info when the title acrosses more than three lines. Signed-off-by: Wang YanQing --- Hi! Joe This is the third patch based on previous two patches. Thanks. scripts/checkpatch.pl | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a1e4113..e9c46d3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2899,15 +2899,27 @@ sub process { $orig_desc = $1; $has_parens_and_dqm = 1; } elsif ($line =~ /\b$prefix\s+[0-9a-f]{5,}\s+\(".+$/i && - defined $rawlines[$linenr] && - $rawlines[$linenr] =~ /^\s*.+"\)/) { - $line =~ /\b$prefix\s+[0-9a-f]{5,}\s+\("(.+)$/i; - $orig_desc = $1; - $rawlines[$linenr] =~ /^\s*(.+)"\)/; - $orig_desc .= " " . $1; - $has_parens_and_dqm = 1; - - if ($prefix eq "Fixes:") { + defined $rawlines[$linenr]) { + if ($rawlines[$linenr] =~ /^\s*.+"\)/) { + $line =~ /\b$prefix\s+[0-9a-f]{5,}\s+\("(.+)$/i; + $orig_desc = $1; + $rawlines[$linenr] =~ /^\s*(.+)"\)/; + $orig_desc .= " " . $1; + $has_parens_and_dqm = 1; + } elsif (defined $rawlines[$linenr + 1] && + $rawlines[$linenr + 1] =~ /^\s*.+"\)/) { + $line =~ /\b$prefix\s+[0-9a-f]{5,}\s+\("(.+)$/i; + $orig_desc = $1; + $rawlines[$linenr] =~ /^\s*(.+)/; + $orig_desc .= " " . $1; + $rawlines[$linenr + 1] =~ /^\s*(.+)"\)/; + $orig_desc .= " " . $1; + $has_parens_and_dqm = 1; + } else { + $diagnostics .= "Missing terminal '\")' at the end of title or the title acrosses more than 3 lines.\n"; + } + + if ($has_parens_and_dqm && $prefix eq "Fixes:") { $acrosslines = 1; $diagnostics .= "The title acrosses lines.\n"; } -- 1.8.5.6.2.g3d8a54e.dirty