Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
* [PATCH] Allow whitespace before a trailer
@ 2021-12-14 21:43 Rob Herring
  2021-12-15  5:52 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring @ 2021-12-14 21:43 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools, Greg Kroah-Hartman

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-01 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox