We have a very log list of recipients...displaying that list on every push is annoying Add an option to prevent printing the list of email addresses from the hook Signed-off-by: Dave Boutcher <daveboutcher@xxxxxxxxx> --- git-multimail/README | 3 +++ git-multimail/git_multimail.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/git-multimail/README b/git-multimail/README index a40847a..49e0937 100644 --- a/git-multimail/README +++ b/git-multimail/README @@ -396,6 +396,9 @@ multimailhook.replyToRefchange - The value "none", in which case the Reply-To: field will be omitted. +multimailhook.quiet + + Do not output the list of email recipients from the hook Email filtering aids -------------------- diff --git a/git-multimail/git_multimail.py b/git-multimail/git_multimail.py index 5ed253f..095110a 100755 --- a/git-multimail/git_multimail.py +++ b/git-multimail/git_multimail.py @@ -1582,6 +1582,9 @@ class Environment(object): commit mail. The value should be a list of strings representing words to be passed to the command. + quiet (bool) + On success do not write to stderr + """ REPO_NAME_RE = re.compile(r'^(?P<name>.+?)(?:\.git)$') @@ -1594,6 +1597,7 @@ class Environment(object): self.logopts = [] self.refchange_showlog = False self.commitlogopts = ['-C', '--stat', '-p', '--cc'] + self.quiet = False self.COMPUTED_KEYS = [ 'administrator', @@ -1745,6 +1749,10 @@ class ConfigOptionsEnvironmentMixin(ConfigEnvironmentMixin): 'refchangeshowlog', default=self.refchange_showlog ) + self.quiet = config.get_bool( + 'quiet', default=False + ) + maxcommitemails = config.get('maxcommitemails') if maxcommitemails is not None: try: @@ -2376,7 +2384,8 @@ class Push(object): % (change.refname, change.old.sha1, change.new.sha1,) ) else: - sys.stderr.write('Sending notification emails to: %s\n' % (change.recipients,)) + if not self.environment.quiet: + sys.stderr.write('Sending notification emails to: %s\n' % (change.recipients,)) extra_values = {'send_date': send_date.next()} mailer.send( change.generate_email(self, body_filter, extra_values), -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html