aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--b4/ez.py11
-rw-r--r--docs/config.rst6
2 files changed, 17 insertions, 0 deletions
diff --git a/b4/ez.py b/b4/ez.py
index 3971b6f..ec8bf77 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1192,6 +1192,17 @@ def get_prep_branch_as_patches(movefrom: bool = True, thread: bool = True, addtr
if addtracking:
patches[0][1].add_header('X-B4-Tracking', thdata)
+ samethread = config.get('send-same-thread', '').lower() in {'yes', 'true', 'y'}
+ if samethread and revision > 1:
+ oldrev = revision - 1
+ voldrev = f'v{oldrev}'
+ try:
+ oldmsgid = tracking['series']['history'][voldrev][-1]
+ patches[0][1].add_header('In-Reply-To', f'<{oldmsgid}>')
+ patches[0][1].add_header('References', f'<{oldmsgid}>')
+ except (KeyError, IndexError):
+ logger.debug('Could not find previous series msgid, skipping %s', voldrev)
+
tag_msg = f'{csubject.full_subject}\n\n{cover_letter}'
return alltos, allccs, tag_msg, patches
diff --git a/docs/config.rst b/docs/config.rst
index caa6e38..389badf 100644
--- a/docs/config.rst
+++ b/docs/config.rst
@@ -363,6 +363,12 @@ Contributor-oriented settings
Default:: ``scripts/get_maintainer.pl --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nom``
+``b4.send-same-thread`` (v0.13+)
+ 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.
+
+ Default: ``no``
``b4.prep-cover-strategy`` (v0.10+)
Alternative cover letter storage strategy to use (see :ref:`prep_cover_strategies`).