aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/gitutil.py
diff options
context:
space:
mode:
authorNicolas Boichat2020-07-13 10:50:00 +0800
committerSimon Glass2020-07-25 14:46:57 -0600
commit949775689e58cf7ebf96b9da7f259820e8ad4f32 (patch)
treea166c0ee96431cca09cd98c8357b5e451d156a30 /tools/patman/gitutil.py
parent50c7b723bd47cc8516ea84690f3f07b65a9ee8d6 (diff)
patman: Make sure sendemail.suppresscc is (un)set correctly
Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd parameter being ignored, and emails going either nowhere, or just to the To: line maintainer. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/gitutil.py')
-rw-r--r--tools/patman/gitutil.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index b683481a574..192d8e69b32 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -344,6 +344,31 @@ def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True):
return ['%s %s%s%s' % (tag, quote, email, quote) for email in result]
return result
+def CheckSuppressCCConfig():
+ """Check if sendemail.suppresscc is configured correctly.
+
+ Returns:
+ True if the option is configured correctly, False otherwise.
+ """
+ suppresscc = command.OutputOneLine('git', 'config', 'sendemail.suppresscc',
+ raise_on_error=False)
+
+ # Other settings should be fine.
+ if suppresscc == 'all' or suppresscc == 'cccmd':
+ col = terminal.Color()
+
+ print((col.Color(col.RED, "error") +
+ ": git config sendemail.suppresscc set to %s\n" % (suppresscc)) +
+ " patman needs --cc-cmd to be run to set the cc list.\n" +
+ " Please run:\n" +
+ " git config --unset sendemail.suppresscc\n" +
+ " Or read the man page:\n" +
+ " git send-email --help\n" +
+ " and set an option that runs --cc-cmd\n")
+ return False
+
+ return True
+
def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
self_only=False, alias=None, in_reply_to=None, thread=False,
smtp_server=None):