All of lore.kernel.org
 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 2/2] trailers: add 'Closes' as recognized link trailer
Date: Thu, 25 May 2023 22:10:37 +0200	[thread overview]
Message-ID: <20230525-closes-tags-v1-2-ed41b1773cb6@tessares.net> (raw)
In-Reply-To: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net>

The Closes tag has been used for quite a long time in the Linux kernel,
mainly by DRM and MPTCP subsystems. It is used by some bug trackers like
GitHub, GitLab and bugzilla.kernel.org to automate the closure of issues
when a patch is accepted.

In Linux 6.3, checkpatch started to complain about this tag because it
has never been described in the documentation. The situation has changed
in Linux 6.4 [1]: I initially just wanted to allow the Closes tag but
some reviewers pointed out that bots reading mailing lists like RegzBot
would be interested to have it instead of the Link tag when any kind of
bug is being closed. So now after a Reported-by, checkpatch.pl now
suggests to add a Closes with a link.

In other words, it is now more common to see this Closes tag in the
Linux kernel. It is certainly used in many other projects than the Linux
kernel.

This Closes tag is treated as a Link tag.

Note that existing test files have been modified. You will probably need
to run "pytest --cache-clear" to avoid using the previous version.

Link: https://lore.kernel.org/all/20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net/ [1]
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Closes: https://lore.kernel.org/all/CAKwvOdm=Zk8YhrPptN3k7UQo+1n7Ws=Qox=BwTR9bbjPJJYz8A@mail.gmail.com/
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 b4/__init__.py                                           | 4 ++--
 tests/samples/trailers-thread-with-cover-followup.mbox   | 1 +
 tests/samples/trailers-thread-with-cover-followup.verify | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/b4/__init__.py b/b4/__init__.py
index e9e7b64..44deacd 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -885,7 +885,7 @@ class LoreTrailer:
     addr: Optional[Tuple[str, str]] = None
     lmsg = None
     # Small list of recognized utility trailers
-    _utility: Set[str] = {'fixes', 'link', 'buglink', 'obsoleted-by', 'message-id', 'change-id', 'base-commit'}
+    _utility: Set[str] = {'fixes', 'link', 'buglink', 'closes', 'obsoleted-by', 'message-id', 'change-id', 'base-commit'}
 
     def __init__(self, name: Optional[str] = None, value: Optional[str] = None, extinfo: Optional[str] = None,
                  msg: Optional[email.message.Message] = None):
@@ -1656,7 +1656,7 @@ class LoreMessage:
     def find_trailers(body: str, followup: bool = False) -> Tuple[List[LoreTrailer], List[str]]:
         ignores = {'phone', 'email'}
         headers = {'subject', 'date', 'from'}
-        links = {'link', 'buglink'}
+        links = {'link', 'buglink', 'closes'}
         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'
diff --git a/tests/samples/trailers-thread-with-cover-followup.mbox b/tests/samples/trailers-thread-with-cover-followup.mbox
index bbdeeeb..5c4e64e 100644
--- a/tests/samples/trailers-thread-with-cover-followup.mbox
+++ b/tests/samples/trailers-thread-with-cover-followup.mbox
@@ -226,6 +226,7 @@ To: list@example.org
 
 Tested-by: Follow Upper <follow.upper@example.org>
 Link: https://example.org
+Closes: https://example.org/bug/1234
 
 -- 
 Follow Upper
diff --git a/tests/samples/trailers-thread-with-cover-followup.verify b/tests/samples/trailers-thread-with-cover-followup.verify
index b42e1ed..acd6278 100644
--- a/tests/samples/trailers-thread-with-cover-followup.verify
+++ b/tests/samples/trailers-thread-with-cover-followup.verify
@@ -5,6 +5,7 @@ Life imitatus artem.
 Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
 Tested-by: Follow Upper <follow.upper@example.org>
 Link: https://example.org
+Closes: https://example.org/bug/1234
 Reviewed-by: Cover Upper <cover.upper@example.org>
 Signed-off-by: Test Override <test-override@example.com>
 ---

-- 
2.39.2


  parent 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 ` [PATCH b4 1/2] trailers: accept recognized link trailers Matthieu Baerts
2023-05-25 20:10 ` Matthieu Baerts [this message]
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-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.