Allow whitespace before a trailer
PATCH 1/1 Allow whitespace before a trailer
Currently, b4 fails to find and add trailers with leading whitespace. Let's be a bit more forgiving and allow for that case.
---
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(-)
b4/__init__.py +1 -1
@@ -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
Signature · 1 line
2.32.0
Quoted 31 lines · Rob Herring
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 <[email protected]>Signed-off-by Rob Herring <[email protected]>---
This thread exhibits the problem:
https://lore.kernel.org/r/20211206174113.2295616-1-robh%40kernel.orgNote 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(-)b4/__init__.py +1
-1@@ -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 linesSignature · 1 line
2.32.0
Hah, sorry about that, I assumed that b4 was picking these up properly, my fault.
Quoted 4 lines · Rob Herring
Currently, b4 fails to find and add trailers with leading whitespace. Let's be a bit more forgiving and allow for that case.
Quoted 8 lines
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Rob Herring <[email protected]>---
This thread exhibits the problem:
https://lore.kernel.org/r/20211206174113.2295616-1-robh%40kernel.orgNote that patchwork also fails on this. Between fixing b4 or Greg, I went with b4. :)
ping!
Quoted 21 lines
--- b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)b4/__init__.py +1
-2@@ -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
Quoted 2 lines · Rob Herring
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.
Quoted 18 lines
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Rob Herring <[email protected]>---
This thread exhibits the problem:
https://lore.kernel.org/r/20211206174113.2295616-1-robh%40kernel.orgNote 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(-)b4/__init__.py +0
-0
b4/__init__.py class LoreMessage: · line 1400
Quoted 5 lines
b4/__init__.py +1
-1@@ -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.
b4/__init__.py class LoreMessage: · line 1403
Quoted 3 lines
b4/__init__.py +0
-0if matches: groups = list(matches.groups()) # We only accept headers if we haven't seen any non-trailer lines
Thanks,
-K