From: Rob Herring <robh@kernel.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] Allow whitespace before a trailer
Date: Tue, 14 Dec 2021 15:43:27 -0600 [thread overview]
Message-ID: <20211214214327.4003631-1-robh@kernel.org> (raw)
Currently, b4 fails to find and add trailers with leading whitespace. Let's
be a bit more forgiving and allow for that case.
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)
if matches:
groups = list(matches.groups())
# We only accept headers if we haven't seen any non-trailer lines
--
2.32.0
next reply other threads:[~2021-12-14 21:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 21:43 Rob Herring [this message]
2021-12-15 5:52 ` [PATCH] Allow whitespace before a trailer Greg Kroah-Hartman
2022-01-31 20:07 ` Rob Herring
2022-02-01 15:41 ` Konstantin Ryabitsev
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=20211214214327.4003631-1-robh@kernel.org \
--to=robh@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=konstantin@linuxfoundation.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