aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-06-08 14:03:27 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-06-08 14:03:27 -0400
commit1f946b903ee0ba42df9107dc484dcd5ff27b83d3 (patch)
tree12a5dfeb50c9c238a28e8804cc8288d850a78cb3
parentc784afbdbed77155dd90904809003c90e9b43e76 (diff)
downloadb4-1f946b903ee0ba42df9107dc484dcd5ff27b83d3.tar.gz
Output less confusing trailer mismatch messages
Show the actual trailer name we're complaining about. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py4
-rw-r--r--b4/mbox.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 06bc33e..943f623 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -284,7 +284,7 @@ class LoreMailbox:
trailers, mismatches = fmsg.get_trailers(sloppy=sloppytrailers)
for tname, tvalue in mismatches:
- lser.trailer_mismatches.add((tvalue, fmsg.fromname, fmsg.fromemail))
+ lser.trailer_mismatches.add((tname, tvalue, fmsg.fromname, fmsg.fromemail))
lvl = 1
while True:
logger.debug('%sParent: %s', ' ' * lvl, pmsg.full_subject)
@@ -881,7 +881,7 @@ class LoreMessage:
# Do we have something that looks like a person-trailer?
matches = re.findall(r'^\s*([\w-]+):[ \t]+(.*<\S+>)\s*$', self.body, re.MULTILINE)
# These are commonly part of patch/commit metadata
- badtrailers = ('from', 'author')
+ badtrailers = ('from', 'author', 'cc')
if matches:
for tname, tvalue in matches:
if tname.lower() not in badtrailers:
diff --git a/b4/mbox.py b/b4/mbox.py
index 85f9fcd..ab8dcea 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -127,9 +127,9 @@ def mbox_to_am(mboxfile, cmdargs):
if len(lser.trailer_mismatches):
logger.critical('---')
logger.critical('NOTE: some trailers ignored due to from/email mismatches:')
- for tvalue, fname, femail in lser.trailer_mismatches:
- logger.critical(' ! Trailer: %s', tvalue)
- logger.critical(' From: %s <%s>', fname, femail)
+ for tname, tvalue, fname, femail in lser.trailer_mismatches:
+ logger.critical(' ! Trailer: %s: %s', tname, tvalue)
+ logger.critical(' Msg From: %s <%s>', fname, femail)
logger.critical('NOTE: Rerun with -S to apply them anyway')
topdir = None