@@ -398,8 +398,14 @@ Contributor-oriented settings
``b4.send-same-thread`` (v0.13+)
When sending a new version of a series, send it in the same thread as
- the previous version. B4 sends the first message of the new series as
- a reply to the previous version's cover letter.
+ the previous version. The config supports the following values:
+
+ * ``yes``, ``true``, ``y``: B4 sends the first message of the new series as a
+ reply to the previous version's cover letter.
+ * ``shallow``: B4 sends the first message of the new series as a reply to the
+ first version's cover letter.
+ * ``no``: B4 does not send the new version of the series in the same thread
+ as any previous version.
Default: ``no``
@@ -1594,9 +1594,12 @@ def get_prep_branch_as_patches(movefrom: bool = True, thread: bool = True, addtr
# Add X-Change-ID header
patches[0][1].add_header('X-Change-ID', change_id)
- samethread = config.get('send-same-thread', '').lower() in {'yes', 'true', 'y'}
- if samethread and revision > 1:
+ samethread = config.get('send-same-thread', '').lower()
+ if samethread in {'yes', 'true', 'y', 'shallow'} and revision > 1:
oldrev = revision - 1
+ if samethread == 'shallow':
+ oldrev = 1
+
voldrev = f'v{oldrev}'
try:
oldmsgid = tracking['series']['history'][voldrev][-1]
When setting "b4.send-same-thread" to a truish value, B4 will send revised versions of a patch series in the same thread. This is done by setting the "In-Reply-To" header to the message ID of the cover letter of the preceding version. This leads to "deep" nesting, where the nth version of a series will be nested n-1 levels below the first version. But not all projects prefer deep nesting. The alternative that is used in some projects is "shallow" nesting: instead of nesting the rerolled version under the preceding version's cover letter, it gets nested under the first version's cover letter. Implement support for a new "shallow" value for "b4.send-same-thread" that does exactly this. Signed-off-by: Patrick Steinhardt <ps@pks.im> --- I've recently started to experiment with B4 in the context of the Git mailing list. Most folks over there don't use deep nesting for patch series and instead prefer to shallowly nest patch series, which is what this patch implements. --- docs/config.rst | 10 ++++++++-- src/b4/ez.py | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) --- base-commit: 355e82083f0eba59abf31521977dda09fab8bff5 change-id: 20241112-pks-shallow-threads-8d00bf73c752 Best regards,