Linux Kernel Mentees list
 help / color / mirror / Atom feed
From: Peilin Ye <yepeilin.cs@gmail.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH RFC] checkpatch: add warning for lines starting with a '#' in commit log
Date: Tue, 1 Dec 2020 12:49:43 -0500	[thread overview]
Message-ID: <20201201174943.GA32955@PWN> (raw)
In-Reply-To: <20201201155212.132233-1-dwaipayanray1@gmail.com>

On Tue, Dec 01, 2020 at 09:22:12PM +0530, Dwaipayan Ray wrote:
> Commit log lines starting with a '#' can be ignored by git if the
> corresponding commit message is reworded by a maintainer using
> git commit --ammend. This minute error can be easily avoided if

s/minute/minor/

> checkpatch warns for the same.
> 
> Add a new check which emits a warning on finding lines starting with
> a '#'. Also add a quick fix by adding a tab infront of such lines.

s/infront/in front/

> Suggested-by: Peilin Ye <yepeilin.cs@gmail.com>
> Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com>
> ---
>  scripts/checkpatch.pl | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index dabe39ca819e..10665b9a3d77 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 an #
> +		if ($in_commit_log && $line =~ /^#/) {
> +			if (WARN("POSSIBLE_IGNORED_LINE",
> +				 "Commit log lines starting with a '#' might be ignored if the commit message is reworded using git commit --ammend.\n" . $herecurr)

Also a nitpick, `commit --amend` isn't the only way to reword it, I did
it using `rebase -i`.

I think something like "Commit log lines starting with a '#' might be
dropped by git.\n" is sufficient, without being overspecific?

Otherwise,

Tested-by: Peilin Ye <yepeilin.cs@gmail.com>

Thank you,
Peilin Ye

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-12-01 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 15:52 [Linux-kernel-mentees] [PATCH RFC] checkpatch: add warning for lines starting with a '#' in commit log Dwaipayan Ray
2020-12-01 17:49 ` Peilin Ye [this message]
2020-12-01 18:06   ` Dwaipayan Ray
2020-12-01 18:08     ` Lukas Bulwahn
2020-12-01 17:58 ` Peilin Ye

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=20201201174943.GA32955@PWN \
    --to=yepeilin.cs@gmail.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    /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