aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-08-22 13:37:35 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-08-22 13:37:35 -0400
commit138adb3faf9b5c622100169c2518f5d9e81672bb (patch)
treef629d4fb3218a976d0289b06c41e98d83896117c
parent6d8abb347af380dab9c7952260622f955d86c995 (diff)
downloadb4-138adb3faf9b5c622100169c2518f5d9e81672bb.tar.gz
ez: allow defining commands for getting To: and Cc: addresses
We will still use get_maintainer.pl if we find it, but it is now possible to override it with send-auto-to-cmd and send-auto-cc-cmd config values. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ez.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/b4/ez.py b/b4/ez.py
index d1f1040..a175a33 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -973,16 +973,22 @@ def cmd_send(cmdargs: argparse.Namespace) -> None:
if not cmdargs.no_auto_to_cc:
logger.info('Populating the To: and Cc: fields with automatically collected addresses')
- # Use a sane tocmd and cccmd for the kernel
- # TODO: make it definable in the config
+ topdir = b4.git_get_toplevel()
+ # Use sane tocmd and cccmd defaults if we find a get_maintainer.pl
tocmdstr = tocmd = None
cccmdstr = cccmd = None
- topdir = b4.git_get_toplevel()
getm = os.path.join(topdir, 'scripts', 'get_maintainer.pl')
- if os.access(getm, os.X_OK):
- logger.info('Using kernel get_maintainer.pl for to and cc lists')
+ if config.get('send-auto-to-cmd'):
+ tocmdstr = config.get('send-auto-to-cmd')
+ elif os.access(getm, os.X_OK):
+ logger.info('Invoking get_maintainer.pl for To: addresses')
tocmdstr = f'{getm} --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nol'
+ if config.get('send-auto-cc-cmd'):
+ cccmdstr = config.get('send-auto-cc-cmd')
+ elif os.access(getm, os.X_OK):
+ logger.info('Invoking get_maintainer.pl for Cc: addresses')
cccmdstr = f'{getm} --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nom'
+
if tocmdstr:
sp = shlex.shlex(tocmdstr, posix=True)
sp.whitespace_split = True