From e4e04764009f749665636c4d11e0cafd9c4971e1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 22 Aug 2014 06:53:14 -0700 Subject: [PATCH] mail: auto cc cover letter to union of all attribution tags in a series If a receiver is only copied on the a single patch out of a larger series she may not have the necessary context to judge the patch. Auto cc her on the cover letter. Signed-off-by: Dan Williams Signed-off-by: Catalin Marinas --- stgit/commands/mail.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index e033382..ff9f2e1 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -533,8 +533,18 @@ def __build_cover(tmpl, msg_id, options, patches): except Exception, ex: raise CmdException, 'template parsing error: %s' % str(ex) + extra_cc = [] + if options.auto: + for patch in patches: + p = crt_series.get_patch(patch) + if p.get_description(): + descr = p.get_description().strip() + extra_cc.extend(__get_signers_list(descr)) + extra_cc = list(set(extra_cc)) + + if not options.git: - __build_address_headers(msg, options) + __build_address_headers(msg, options, extra_cc) __build_extra_headers(msg, msg_id, options.in_reply_to) __encode_message(msg) -- 2.11.4.GIT