diff mbox series

[b4,2/3] ez: add '--same-thread' option to 'b4 send'

Message ID 20230219-send-iterations-in-same-thread-v1-2-59b802382eb5@gmail.com (mailing list archive)
State Superseded
Headers show
Series ez: allow sending all versions of a patch series in the same thread | expand

Commit Message

Philippe Blain Feb. 22, 2023, 1:29 a.m. UTC
The previous commit tweaked get_prep_branch_as_patches to optionnally
send further iterations of a patch series in the same thread as previous
ones.

Expose that functionality to the command line by adding a
'--same-thread' option (defaulting to False) to 'b4 send', and pass it
down to get_prep_branch_as_patches. Document the new feature.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 b4/command.py             | 2 ++
 b4/ez.py                  | 2 +-
 docs/contributor/send.rst | 5 +++++
 3 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/b4/command.py b/b4/command.py
index a7a5aa9..21f0d0d 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -323,6 +323,8 @@  def setup_parser() -> argparse.ArgumentParser:
                          help='Resend a previously sent version of the series')
     sp_send.add_argument('--no-sign', action='store_true', default=False,
                          help='Do not add the cryptographic attestation signature header')
+    sp_send.add_argument('--same-thread', action='store_true', default=False,
+                         help='Keep all versions in the same thread')
     ag_sendh = sp_send.add_argument_group('Web submission', 'Authenticate with the web submission endpoint')
     ag_sendh.add_argument('--web-auth-new', dest='auth_new', action='store_true', default=False,
                           help='Initiate a new web authentication request')
diff --git a/b4/ez.py b/b4/ez.py
index dac5e2a..4013f29 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1295,7 +1295,7 @@  def cmd_send(cmdargs: argparse.Namespace) -> None:
             sys.exit(1)
 
         try:
-            todests, ccdests, tag_msg, patches = get_prep_branch_as_patches()
+            todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=cmdargs.same_thread)
         except RuntimeError as ex:
             logger.critical('CRITICAL: Failed to convert range to patches: %s', ex)
             sys.exit(1)
diff --git a/docs/contributor/send.rst b/docs/contributor/send.rst
index bff67aa..6abceac 100644
--- a/docs/contributor/send.rst
+++ b/docs/contributor/send.rst
@@ -233,6 +233,11 @@  Command line flags
 ``--not-me-too``
   Removes your own email address from the recipients.
 
+``--same-thread``
+  When sending a new version of a series, make it part of the same
+  thread as the previous one. The first mail will be sent as a reply
+  to the previous version's cover letter.
+
 ``--no-sign``
   Don't sign your patches with your configured attestation mechanism.
   Note, that patch signing is required for the web submission endpoint,