diff mbox series

[b4,3/3] ez: add 'b4.send-same-thread' config for 'b4 send --same-thread'

Message ID 20230219-send-iterations-in-same-thread-v1-3-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
Allow the default for the '--same-thread' option of 'b4 send' to be set
in b4's config by adding a 'b4.send-same-thread' configuration option.

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

Patch

diff --git a/b4/ez.py b/b4/ez.py
index 4013f29..f0861ed 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1295,7 +1295,10 @@  def cmd_send(cmdargs: argparse.Namespace) -> None:
             sys.exit(1)
 
         try:
-            todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=cmdargs.same_thread)
+            samethread = config.get('send-same-thread', '').lower() in {'yes', 'true', 'y'}
+            if cmdargs.same_thread or samethread:
+                samethread = True
+            todests, ccdests, tag_msg, patches = get_prep_branch_as_patches(samethread=samethread)
         except RuntimeError as ex:
             logger.critical('CRITICAL: Failed to convert range to patches: %s', ex)
             sys.exit(1)
diff --git a/docs/config.rst b/docs/config.rst
index b3ab5ca..0fd68c5 100644
--- a/docs/config.rst
+++ b/docs/config.rst
@@ -351,6 +351,10 @@  Contributor-oriented settings
 
   Default:: ``scripts/get_maintainer.pl --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nom``
 
+``b4.send-same-thread`` (v0.13+)
+  Send all versions of a patch series as part of the same thread.
+
+  Default: ``no``
 
 ``b4.prep-cover-strategy`` (v0.10+)
   Alternative cover letter storage strategy to use (see :ref:`prep_cover_strategies`).