From: Dwaipayan Ray <dwaipayanray1@gmail.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH v2] checkpatch: extend author Signed-off-by check for split From: header
Date: Sun, 20 Sep 2020 02:45:09 +0530 [thread overview]
Message-ID: <CABJPP5Abo1qzO+G=SEzhCLGwoiH+hgicDMy3gMmSwKBvOQcn8A@mail.gmail.com> (raw)
In-Reply-To: <20200919204721.100531-1-dwaipayanray1@gmail.com>
On Sun, Sep 20, 2020 at 2:18 AM Dwaipayan Ray <dwaipayanray1@gmail.com> wrote:
>
> Checkpatch did not handle cases where the author From: header
> was split into multiple lines. The author identity could not
> be resolved and checkpatch generated a false NO_AUTHOR_SIGN_OFF
> warning.
>
> Support split From: headers in AUTHOR_SIGN_OFF check by correctly
> parsing the entire From: header in such cases.
>
> Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com>
> ---
> scripts/checkpatch.pl | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 504d2e431c60..8ee61ec346b3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2661,6 +2661,10 @@ sub process {
> # Check the patch for a From:
> if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
> $author = $1;
> + my $curline = $linenr-1;
> + while(defined($rawlines[++$curline]) && ($rawlines[$curline] =~ /^\s+(.*)/)) {
> + $author.= $1;
> + }
> $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
> $author =~ s/"//g;
> $author = reformat_email($author);
> --
> 2.27.0
>
Hi,
Based on Joe's suggestions I updated the patch. It's totally similar
except for the fact that Joe missed a closing parenthesis and
he removed the decode("MIME-Header") part which caused parsing
of utf-8 to fail.
example: (commit e33bcbab16d1)
WARNING: Missing Signed-off-by: line by nominal patch author
'"=?UTF-8?q?Vesa=20J=C3=A4=C3=A4skel=C3=A4inen?="
<vesa.jaaskelainen@vaisala.com>
So I fixed these.
Also, Joe stated that all split lines must start with a space. But I
looked it up and it states that it must be a WSP, that is either a
single space or a horizontal tab.
References:
WSP: (https://www.rfc-editor.org/std/std68.txt)
Long headers: https://tools.ietf.org/html/rfc2822#section-2.2.3
So, i went with the ^\s+ expression instead of ^ s*. Is it alright
or should be changed?
I do have a final question though, since he had already solved it,
is it okay to send this patch in again?
Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-09-19 21:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-19 20:47 [Linux-kernel-mentees] [PATCH v2] checkpatch: extend author Signed-off-by check for split From: header Dwaipayan Ray
2020-09-19 21:15 ` Dwaipayan Ray [this message]
2020-09-20 8:11 ` Lukas Bulwahn
2020-09-20 8:01 ` Lukas Bulwahn
2020-09-20 9:17 Dwaipayan Ray
2020-09-20 15:09 ` Joe Perches
2020-09-20 16:22 ` Dwaipayan Ray
2020-09-20 16:54 ` Joe Perches
2020-09-21 7:39 ` Lukas Bulwahn
2020-09-21 9:47 ` Joe Perches
2020-09-20 17:39 ` Joe Perches
2020-09-21 7:49 ` Lukas Bulwahn
2020-09-21 8:31 ` Dwaipayan Ray
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='CABJPP5Abo1qzO+G=SEzhCLGwoiH+hgicDMy3gMmSwKBvOQcn8A@mail.gmail.com' \
--to=dwaipayanray1@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=lukas.bulwahn@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;
as well as URLs for NNTP newsgroup(s).