From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Rob Herring <robh@kernel.org>
Cc: tools@linux.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] Allow whitespace before a trailer
Date: Tue, 1 Feb 2022 10:41:15 -0500 [thread overview]
Message-ID: <20220201154115.dp75wozotcmgyjdg@meerkat.local> (raw)
In-Reply-To: <20211214214327.4003631-1-robh@kernel.org>
On Tue, Dec 14, 2021 at 03:43:27PM -0600, Rob Herring wrote:
> Currently, b4 fails to find and add trailers with leading whitespace. Let's
> be a bit more forgiving and allow for that case.
Okay, I think this is fairly safe and hopefully won't result in more
false-positives.
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> This thread exhibits the problem:
> https://lore.kernel.org/r/20211206174113.2295616-1-robh%40kernel.org
>
> Note that patchwork also fails on this. Between fixing b4 or Greg, I
> went with b4. :)
>
> ---
> b4/__init__.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/b4/__init__.py b/b4/__init__.py
> index 11c287eb3433..a4add56c5f80 100644
> --- a/b4/__init__.py
> +++ b/b4/__init__.py
> @@ -1397,7 +1397,7 @@ class LoreMessage:
> was_trailer = False
> for line in body.split('\n'):
> line = line.strip('\r')
> - matches = re.search(r'^(\w\S+):\s+(\S.*)', line, flags=re.I)
> + matches = re.search(r'^\s?(\w\S+):\s+(\S.*)', line, flags=re.I)
I used a \s* instead, since there may be more than a single whitespace
character. It's in master and stable-0.8.y.
> if matches:
> groups = list(matches.groups())
> # We only accept headers if we haven't seen any non-trailer lines
Thanks,
-K
prev parent reply other threads:[~2022-02-01 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 21:43 [PATCH] Allow whitespace before a trailer Rob Herring
2021-12-15 5:52 ` Greg Kroah-Hartman
2022-01-31 20:07 ` Rob Herring
2022-02-01 15:41 ` Konstantin Ryabitsev [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=20220201154115.dp75wozotcmgyjdg@meerkat.local \
--to=konstantin@linuxfoundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=robh@kernel.org \
--cc=tools@linux.kernel.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;
as well as URLs for NNTP newsgroup(s).