@@ -1656,7 +1656,8 @@ class LoreMessage:
def find_trailers(body: str, followup: bool = False) -> Tuple[List[LoreTrailer], List[str]]:
ignores = {'phone', 'email'}
headers = {'subject', 'date', 'from'}
- nonperson = {'fixes', 'subject', 'date', 'link', 'buglink', 'obsoleted-by', 'change-id', 'base-commit'}
+ links = {'link', 'buglink'}
+ nonperson = links | {'fixes', 'subject', 'date', 'obsoleted-by', 'change-id', 'base-commit'}
# Ignore everything below standard email signature marker
body = body.split('\n-- \n', 1)[0].strip() + '\n'
# Fix some more common copypasta trailer wrapping
@@ -1695,7 +1696,8 @@ class LoreMessage:
if not mperson and lname not in nonperson:
logger.debug('Ignoring %s (not a recognized non-person trailer)', line)
continue
- if re.search(r'https?://', ovalue):
+ mlink = re.search(r'https?://', ovalue)
+ if mlink and lname not in links:
logger.debug('Ignoring %s (not a recognized link trailer)', line)
continue
@@ -225,6 +225,7 @@ To: list@example.org
> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Tested-by: Follow Upper <follow.upper@example.org>
+Link: https://example.org
--
Follow Upper
@@ -4,6 +4,7 @@ Life imitatus artem.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Tested-by: Follow Upper <follow.upper@example.org>
+Link: https://example.org
Reviewed-by: Cover Upper <cover.upper@example.org>
Signed-off-by: Test Override <test-override@example.com>
---
It looks like all all link trailers were ignored. Now we accept 'link' and 'buglink' that were already in the list of non person categories. Note that existing test files have been modified. You will probably need to run "pytest --cache-clear" to avoid using the previous version. Fixes: 7d1a05e ("trailers: ignore non-recognized link trailers") Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- b4/__init__.py | 6 ++++-- tests/samples/trailers-thread-with-cover-followup.mbox | 1 + tests/samples/trailers-thread-with-cover-followup.verify | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)