From: Joe Perches <joe@perches.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com,
Peilin Ye <yepeilin.cs@gmail.com>
Subject: Re: [PATCH v2] checkpatch: add warning for lines starting with a '#' in commit log
Date: Wed, 02 Dec 2020 12:36:57 -0800 [thread overview]
Message-ID: <0ae44ac0611db460faebda5380661f3b8cb80630.camel@perches.com> (raw)
In-Reply-To: <20201202202229.120898-1-dwaipayanray1@gmail.com>
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/^/ /;
prev parent reply other threads:[~2020-12-02 20:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 20:22 Dwaipayan Ray
2020-12-02 20:36 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ae44ac0611db460faebda5380661f3b8cb80630.camel@perches.com \
--to=joe@perches.com \
--cc=dwaipayanray1@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=yepeilin.cs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®