From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63284C6369E for ; Wed, 2 Dec 2020 21:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1EF721D91 for ; Wed, 2 Dec 2020 21:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728992AbgLBVEF (ORCPT ); Wed, 2 Dec 2020 16:04:05 -0500 Received: from smtprelay0159.hostedemail.com ([216.40.44.159]:50868 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726318AbgLBVEE (ORCPT ); Wed, 2 Dec 2020 16:04:04 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id B7ABA837F24C; Wed, 2 Dec 2020 21:03:23 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: kick66_3f163df273b6 X-Filterd-Recvd-Size: 2574 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Wed, 2 Dec 2020 21:03:22 +0000 (UTC) Message-ID: <51225354b2a533250dad967ef413aaa4f41dfd66.camel@perches.com> Subject: Re: [PATCH v3] checkpatch: add warning for lines starting with a '#' in commit log From: Joe Perches To: Dwaipayan Ray , Andrew Morton Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, Peilin Ye Date: Wed, 02 Dec 2020 13:03:21 -0800 In-Reply-To: <20201202205740.127986-1-dwaipayanray1@gmail.com> References: <20201202205740.127986-1-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-12-03 at 02:27 +0530, Dwaipayan Ray wrote: > Commit log lines starting with '#' are dropped by git as comments. > Add a check to emit a warning for these lines. > > Also add a --fix option to insert a space before the leading '#' in > such lines. > > Suggested-by: Joe Perches > Suggested-by: Peilin Ye > Tested-by: Peilin Ye > Signed-off-by: Dwaipayan Ray Acked-by: Joe Perches > --- > Changes in v3: > - Modify commit message for more clarity > - Modify warning message > - Modify --fix option to substitute single space instead of tab > > Changes in v2: > - Modify warning message and type > - Style fixes > >  scripts/checkpatch.pl | 9 +++++++++ >  1 file changed, 9 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index e8c1ed0b1fad..7940889877ba 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2966,6 +2966,15 @@ sub process { >   $commit_log_possible_stack_dump = 0; >   } >   > > +# Check for lines starting with a # > + if ($in_commit_log && $line =~ /^#/) { > + if (WARN("COMMIT_COMMENT_SYMBOL", > + "Commit log lines starting with '#' are dropped by git as comments\n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =~ s/^/ /; > + } > + } > + >  # Check for git id commit length and improperly formed commit descriptions >   if ($in_commit_log && !$commit_log_possible_stack_dump && >   $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&