From 40c23a568562ec9cc8f81ac8336c257a3b7091e6 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 24 Mar 2020 18:14:49 -0400 Subject: Warn when we are ignoring trailers Provide a warning when we are ignoring trailers due to from/name mismatch between the headers and the body. Also provides a -S,--sloppy-trailers option to ignore all mismatches. Signed-off-by: Konstantin Ryabitsev --- b4/mbox.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'b4/mbox.py') diff --git a/b4/mbox.py b/b4/mbox.py index 5e301c2..7043fa1 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -113,7 +113,7 @@ def mbox_to_am(mboxfile, config, cmdargs): for key, msg in mbx.items(): lmbx.add_message(msg) - lser = lmbx.get_series(revision=wantver) + lser = lmbx.get_series(revision=wantver, sloppytrailers=cmdargs.sloppytrailers) if lser is None and wantver is None: logger.critical('No patches found.') return @@ -156,6 +156,13 @@ def mbox_to_am(mboxfile, config, cmdargs): for trailer in lser.patches[0].followup_trailers: logger.critical(' %s: %s', trailer[0], trailer[1]) 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:') + for tvalue, fname, femail in lser.trailer_mismatches: + logger.critical(' ! Trailer: %s', tvalue) + logger.critical(' From: %s <%s>', fname, femail) + logger.critical('NOTE: Rerun with -S to apply them anyway') logger.critical('---') if not lser.complete: -- cgit v1.2.3