tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Baerts <matthieu.baerts@tessares.net>
To: "Kernel.org Tools" <tools@linux.kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	 Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 Matthieu Baerts <matthieu.baerts@tessares.net>,
	 Follow Upper <follow.upper@example.org>,
	 Cover Upper <cover.upper@example.org>,
	 Test Override <test-override@example.com>
Subject: [PATCH b4 1/2] trailers: accept recognized link trailers
Date: Thu, 25 May 2023 22:10:36 +0200	[thread overview]
Message-ID: <20230525-closes-tags-v1-1-ed41b1773cb6@tessares.net> (raw)
In-Reply-To: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net>

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(-)

diff --git a/b4/__init__.py b/b4/__init__.py
index 1af6993..e9e7b64 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -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
 
diff --git a/tests/samples/trailers-thread-with-cover-followup.mbox b/tests/samples/trailers-thread-with-cover-followup.mbox
index d9dc64a..bbdeeeb 100644
--- a/tests/samples/trailers-thread-with-cover-followup.mbox
+++ b/tests/samples/trailers-thread-with-cover-followup.mbox
@@ -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
diff --git a/tests/samples/trailers-thread-with-cover-followup.verify b/tests/samples/trailers-thread-with-cover-followup.verify
index 6478e6f..b42e1ed 100644
--- a/tests/samples/trailers-thread-with-cover-followup.verify
+++ b/tests/samples/trailers-thread-with-cover-followup.verify
@@ -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>
 ---

-- 
2.39.2


  reply	other threads:[~2023-05-25 20:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 20:10 [PATCH b4 0/2] trailers: accept recognized link trailers + "Closes" Matthieu Baerts
2023-05-25 20:10 ` Matthieu Baerts [this message]
2023-05-25 20:10 ` [PATCH b4 2/2] trailers: add 'Closes' as recognized link trailer Matthieu Baerts
2023-05-26 17:46 ` [PATCH b4 0/2] trailers: accept recognized link trailers + "Closes" 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=20230525-closes-tags-v1-1-ed41b1773cb6@tessares.net \
    --to=matthieu.baerts@tessares.net \
    --cc=cover.upper@example.org \
    --cc=follow.upper@example.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=ndesaulniers@google.com \
    --cc=test-override@example.com \
    --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;
as well as URLs for NNTP newsgroup(s).