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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 81BEBC6369E for ; Wed, 2 Dec 2020 20:37:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 195F2221FA for ; Wed, 2 Dec 2020 20:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727881AbgLBUhk (ORCPT ); Wed, 2 Dec 2020 15:37:40 -0500 Received: from smtprelay0102.hostedemail.com ([216.40.44.102]:42372 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726162AbgLBUhk (ORCPT ); Wed, 2 Dec 2020 15:37:40 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 92772180A9F37; Wed, 2 Dec 2020 20:36:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: net61_25040e9273b6 X-Filterd-Recvd-Size: 1890 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Wed, 2 Dec 2020 20:36:58 +0000 (UTC) Message-ID: <0ae44ac0611db460faebda5380661f3b8cb80630.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: add warning for lines starting with a '#' in commit log From: Joe Perches To: Dwaipayan Ray Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, Peilin Ye Date: Wed, 02 Dec 2020 12:36:57 -0800 In-Reply-To: <20201202202229.120898-1-dwaipayanray1@gmail.com> References: <20201202202229.120898-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: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-12-03 at 01:52 +0530, Dwaipayan Ray wrote: > Commit log lines starting with a '#' can be dropped by git if > the corresponding commit message is reworded by a maintainer. > This minor error can be easily avoided if checkpatch warns > for the same. This makes no sense to me. How about: Commit log lines starting with # are dropped by git as comments so emit a warning for these comment lines. Add a --fix option to insert a space before leading # comments > +# Check for lines starting with a # > + if ($in_commit_log && $line =~ /^#/) { > + if (WARN("COMMIT_COMMENT_SYMBOL", > + "Commit log lines starting with a '#' will be dropped by git as a comment\n" . $herecurr) && Perhaps: "Commit log lines starting with '#' are dropped by git as comments\n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =~ s/^#/\t#/; I suggest using a space char and not a tab to avoid excess indentation. $fixed[$fixlinenr] =~ s/^/ /;