aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2024-02-09 14:29:26 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2024-02-09 14:29:26 -0500
commit9a7cf4895e1ada23dc0b756eb6543943f9fabfbe (patch)
tree75006f652de5c4c4f09c015ee024324b81bd95f4
parent26fb466d12f36b5327f4bdafae5b8f8f62c22fca (diff)
downloadb4-9a7cf4895e1ada23dc0b756eb6543943f9fabfbe.tar.gz
am,shazam: make -t,--apply-cover-trailers the default
As warned in the documentation for a while, make adding cover trailers the default behaviour, as it's pretty much what we always want to do. This makes the existing -t option a no-op. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py5
-rw-r--r--b4/command.py2
-rw-r--r--b4/mbox.py17
-rw-r--r--docs/maintainer/am-shazam.rst6
-rw-r--r--man/b4.56
-rw-r--r--man/b4.5.rst4
-rw-r--r--tests/samples/trailers-followup-partial-reroll-ref-defaults.txt2
-rw-r--r--tests/samples/trailers-followup-with-cover-ref-addlink.txt2
-rw-r--r--tests/samples/trailers-followup-with-cover-ref-covertrailers.txt65
-rw-r--r--tests/samples/trailers-followup-with-cover-ref-defaults.txt2
-rw-r--r--tests/test___init__.py1
11 files changed, 11 insertions, 101 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 14caef7..e5e9e7d 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -614,7 +614,7 @@ class LoreSeries:
if self.patches[0] and self.patches[0].followup_trailers: # noqa
self.add_extra_trailers(self.patches[0].followup_trailers) # noqa
- def get_am_ready(self, noaddtrailers: bool = False, covertrailers: bool = False, addmysob: bool = False,
+ def get_am_ready(self, noaddtrailers: bool = False, addmysob: bool = False,
addlink: bool = False, cherrypick: Optional[List[int]] = None, copyccs: bool = False,
allowbadchars: bool = False) -> List[email.message.Message]:
@@ -697,8 +697,7 @@ class LoreSeries:
logger.info('Some CI checks failed, see patchwork for more info:')
logger.info(' %s', series_url)
- if covertrailers:
- self.add_cover_trailers()
+ self.add_cover_trailers()
at = 1
msgs = list()
diff --git a/b4/command.py b/b4/command.py
index d03263e..be0f033 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -42,7 +42,7 @@ def cmd_am_common_opts(sp):
sp.add_argument('-v', '--use-version', dest='wantver', type=int, default=None,
help='Get a specific version of the patch/series')
sp.add_argument('-t', '--apply-cover-trailers', dest='covertrailers', action='store_true', default=False,
- help='Apply trailers sent to the cover letter to all patches')
+ help='(This is now the default behavior; this option will be removed in the future.)')
sp.add_argument('-S', '--sloppy-trailers', dest='sloppytrailers', action='store_true', default=False,
help='Apply trailers without email address match checking')
sp.add_argument('-T', '--no-add-trailers', dest='noaddtrailers', action='store_true', default=False,
diff --git a/b4/mbox.py b/b4/mbox.py
index 09d1df2..01f218f 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -44,7 +44,6 @@ def make_am(msgs: List[email.message.Message], cmdargs: argparse.Namespace, msgi
if outdir == '-':
cmdargs.nocover = True
wantver = cmdargs.wantver
- covertrailers = cmdargs.covertrailers
count = len(msgs)
logger.info('Analyzing %s messages in the thread', count)
lmbx = b4.LoreMailbox()
@@ -153,10 +152,8 @@ def make_am(msgs: List[email.message.Message], cmdargs: argparse.Namespace, msgi
else:
cherrypick = None
- am_msgs = lser.get_am_ready(noaddtrailers=cmdargs.noaddtrailers,
- covertrailers=covertrailers, addmysob=cmdargs.addmysob,
- addlink=cmdargs.addlink, cherrypick=cherrypick,
- copyccs=cmdargs.copyccs, allowbadchars=cmdargs.allowbadchars)
+ am_msgs = lser.get_am_ready(noaddtrailers=cmdargs.noaddtrailers, addmysob=cmdargs.addmysob, addlink=cmdargs.addlink,
+ cherrypick=cherrypick, copyccs=cmdargs.copyccs, allowbadchars=cmdargs.allowbadchars)
logger.info('---')
if cherrypick is None:
@@ -164,16 +161,6 @@ def make_am(msgs: List[email.message.Message], cmdargs: argparse.Namespace, msgi
else:
logger.info('Total patches: %s (cherrypicked: %s)', len(am_msgs), cmdargs.cherrypick)
- if lser.has_cover and lser.patches[0].followup_trailers and not covertrailers:
- # Warn that some trailers were sent to the cover letter
- logger.critical('---')
- logger.critical('NOTE: Some trailers were sent to the cover letter:')
- tseen = set()
- for ltr in lser.patches[0].followup_trailers:
- if ltr not in tseen:
- logger.critical(' %s', ltr.as_string(omit_extinfo=True))
- tseen.add(ltr)
- logger.critical('NOTE: Rerun with -t to apply them to all patches')
if len(lser.trailer_mismatches):
logger.critical('---')
logger.critical('NOTE: some trailers ignored due to from/email mismatches:')
diff --git a/docs/maintainer/am-shazam.rst b/docs/maintainer/am-shazam.rst
index e6cfec6..e0ecaed 100644
--- a/docs/maintainer/am-shazam.rst
+++ b/docs/maintainer/am-shazam.rst
@@ -90,12 +90,6 @@ The following flags are common to both commands:
patch series revisions, b4 will automatically pick the highest
numbered version. This switch lets you pick a different revision.
-``-t, --apply-cover-trailers``
- By default, b4 will not apply any code review trailers sent to the
- cover letter (but will let you know when it finds those). This lets
- you automatically apply these trailers to all commits in the series.
- **This will become the default in a future version of b4.**
-
``-S, --sloppy-trailers``
B4 tries to be careful when collecting code review trailers and will
refuse to consider the trailers where the email address in the From:
diff --git a/man/b4.5 b/man/b4.5
index 1e24e0c..5317d92 100644
--- a/man/b4.5
+++ b/man/b4.5
@@ -226,9 +226,6 @@ Only retrieve the message matching the msgid and ignore the rest of the thread
.BI \-v \ WANTVER\fR,\fB \ \-\-use\-version \ WANTVER
Get a specific version of the patch/series
.TP
-.B \-t\fP,\fB \-\-apply\-cover\-trailers
-Apply trailers sent to the cover letter to all patches
-.TP
.B \-S\fP,\fB \-\-sloppy\-trailers
Apply trailers without email address match checking
.TP
@@ -323,9 +320,6 @@ Only retrieve the message matching the msgid and ignore the rest of the thread
.BI \-v \ WANTVER\fR,\fB \ \-\-use\-version \ WANTVER
Get a specific version of the patch/series
.TP
-.B \-t\fP,\fB \-\-apply\-cover\-trailers
-Apply trailers sent to the cover letter to all patches
-.TP
.B \-S\fP,\fB \-\-sloppy\-trailers
Apply trailers without email address match checking
.TP
diff --git a/man/b4.5.rst b/man/b4.5.rst
index eaa885f..065e684 100644
--- a/man/b4.5.rst
+++ b/man/b4.5.rst
@@ -150,8 +150,6 @@ options:
Only retrieve the message matching the msgid and ignore the rest of the thread
-v WANTVER, --use-version WANTVER
Get a specific version of the patch/series
- -t, --apply-cover-trailers
- Apply trailers sent to the cover letter to all patches
-S, --sloppy-trailers
Apply trailers without email address match checking
-T, --no-add-trailers
@@ -218,8 +216,6 @@ options:
Only retrieve the message matching the msgid and ignore the rest of the thread
-v WANTVER, --use-version WANTVER
Get a specific version of the patch/series
- -t, --apply-cover-trailers
- Apply trailers sent to the cover letter to all patches
-S, --sloppy-trailers
Apply trailers without email address match checking
-T, --no-add-trailers
diff --git a/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt b/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt
index 2656e54..5f957e4 100644
--- a/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt
+++ b/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt
@@ -13,6 +13,7 @@ Fixes: abcdef01234567890
Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Signed-off-by: Test Override <test-override@example.com>
diff --git a/b4/junk.py b/b4/junk.py
@@ -45,6 +46,7 @@ Fixes: abcdef01234567890
Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Signed-off-by: Test Override <test-override@example.com>
diff --git a/b4/bogus.py b/b4/bogus.py
diff --git a/tests/samples/trailers-followup-with-cover-ref-addlink.txt b/tests/samples/trailers-followup-with-cover-ref-addlink.txt
index 8428a4a..cf58251 100644
--- a/tests/samples/trailers-followup-with-cover-ref-addlink.txt
+++ b/tests/samples/trailers-followup-with-cover-ref-addlink.txt
@@ -13,6 +13,7 @@ Fixes: abcdef01234567890
Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Link: https://lore.kernel.org/r/patch-1-message@example.com
Signed-off-by: Test Override <test-override@example.com>
@@ -46,6 +47,7 @@ Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
Reviewed-by: Followup Reviewer1 <followup-reviewer1@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Link: https://lore.kernel.org/r/patch-2-message@example.com
Signed-off-by: Test Override <test-override@example.com>
diff --git a/tests/samples/trailers-followup-with-cover-ref-covertrailers.txt b/tests/samples/trailers-followup-with-cover-ref-covertrailers.txt
deleted file mode 100644
index 5ef0d7a..0000000
--- a/tests/samples/trailers-followup-with-cover-ref-covertrailers.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-From git@z Thu Jan 1 00:00:00 1970
-Subject: [PATCH v2 1/2] Simple test 1
-From: Test Test <test@example.com>
-Date: Tue, 30 Aug 2022 11:19:07 -0400
-Message-Id: <patch-1-message@example.com>
-MIME-Version: 1.0
-Content-Type: text/plain; charset="utf-8"
-Content-Transfer-Encoding: 7bit
-
-Follow-up trailer collating test patch 1.
-
-Fixes: abcdef01234567890
-Reviewed-by: Original Reviewer <original-reviewer@example.com>
-Link: https://msgid.link/some@msgid.here
-Signed-off-by: Original Submitter <original-submitter@example.com>
-Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
-Signed-off-by: Test Override <test-override@example.com>
-
-diff --git a/b4/junk.py b/b4/junk.py
-index 12345678..23456789 100644
---- a/b4/junk.py
-+++ b/b4/junk.py
-@@@ -1,1 +1,1 @@ def junk():
-
-
--junk1
-+junk2
-
-
---
-2.wong.fu
-
-From git@z Thu Jan 1 00:00:00 1970
-Subject: [PATCH v2 2/2] Simple test 2
-From: Test Test <test@example.com>
-Date: Tue, 30 Aug 2022 11:19:07 -0400
-Message-Id: <patch-2-message@example.com>
-MIME-Version: 1.0
-Content-Type: text/plain; charset="utf-8"
-Content-Transfer-Encoding: 7bit
-
-Follow-up trailer collating test patch 2.
-
-Fixes: abcdef01234567890
-Reviewed-by: Original Reviewer <original-reviewer@example.com>
-Link: https://msgid.link/some@msgid.here
-Signed-off-by: Original Submitter <original-submitter@example.com>
-Reviewed-by: Followup Reviewer1 <followup-reviewer1@example.com>
-Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
-Signed-off-by: Test Override <test-override@example.com>
-
-diff --git a/b4/bupkes.py b/b4/bupkes.py
-index 12345678..23456789 100644
---- a/b4/bupkes.py
-+++ b/b4/bupkes.py
-@@@ -1,1 +1,1 @@ def bupkes():
-
-
--bupkes1
-+bupkes2
-
-
---
-2.wong.fu
-
diff --git a/tests/samples/trailers-followup-with-cover-ref-defaults.txt b/tests/samples/trailers-followup-with-cover-ref-defaults.txt
index 858d103..5ef0d7a 100644
--- a/tests/samples/trailers-followup-with-cover-ref-defaults.txt
+++ b/tests/samples/trailers-followup-with-cover-ref-defaults.txt
@@ -13,6 +13,7 @@ Fixes: abcdef01234567890
Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Signed-off-by: Test Override <test-override@example.com>
diff --git a/b4/junk.py b/b4/junk.py
@@ -45,6 +46,7 @@ Reviewed-by: Original Reviewer <original-reviewer@example.com>
Link: https://msgid.link/some@msgid.here
Signed-off-by: Original Submitter <original-submitter@example.com>
Reviewed-by: Followup Reviewer1 <followup-reviewer1@example.com>
+Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com>
Signed-off-by: Test Override <test-override@example.com>
diff --git a/b4/bupkes.py b/b4/bupkes.py
diff --git a/tests/test___init__.py b/tests/test___init__.py
index b9a9c4c..2fa454f 100644
--- a/tests/test___init__.py
+++ b/tests/test___init__.py
@@ -92,7 +92,6 @@ def test_parse_trailers(sampledir, source, expected):
{'trailer-order': 'Cc,Tested*,Reviewed*,*'}),
('single', {'sloppytrailers': True}, {'addmysob': True}, 'sloppy', {}),
('with-cover', {}, {'addmysob': True}, 'defaults', {}),
- ('with-cover', {}, {'covertrailers': True, 'addmysob': True}, 'covertrailers', {}),
('with-cover', {}, {'addmysob': True, 'addlink': True}, 'addlink', {}),
('custody', {}, {'addmysob': True, 'copyccs': True}, 'unordered', {}),
('custody', {}, {'addmysob': True, 'copyccs': True}, 'ordered',