* [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
* Re: [PATCH] Allow whitespace before a trailer
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
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-15 5:52 UTC (permalink / raw)
To: Rob Herring; +Cc: Konstantin Ryabitsev, tools
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.
>
> 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
Hah, sorry about that, I assumed that b4 was picking these up properly,
my fault.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Allow whitespace before a trailer
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
2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-01-31 20:07 UTC (permalink / raw)
To: Konstantin Ryabitsev; +Cc: tools, Greg Kroah-Hartman
On Tue, Dec 14, 2021 at 3:43 PM Rob Herring <robh@kernel.org> wrote:
>
> 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. :)
ping!
>
> ---
> 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 [flat|nested] 4+ messages in thread
* Re: [PATCH] Allow whitespace before a trailer
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
2 siblings, 0 replies; 4+ messages in thread
From: Konstantin Ryabitsev @ 2022-02-01 15:41 UTC (permalink / raw)
To: Rob Herring; +Cc: tools, Greg Kroah-Hartman
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
^ permalink raw reply [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;
as well as URLs for NNTP newsgroup(s).