Sets the cover letter contents for the series. The first line
will become the subject of the cover letter
+Cover-letter-cc: email / alias
+ Additional email addresses / aliases to send cover letter to (you
+ can add this multiple times)
+
Series-notes:
blah blah
blah blah
afleming.
If you have a cover letter it will get sent to the union of the CC lists of
-all of the other patches.
+all of the other patches. If you want to sent it to additional people you
+can add a tag:
+
+Cover-letter-cc: <list of addresses>
+
+These people will get the cover letter even if they are not on the To/Cc
+list for any of the patches.
Example Work Flow
# The start of the cover letter
re_cover = re.compile('^Cover-letter:')
+# A cover letter Cc
+re_cover_cc = re.compile('^Cover-letter-cc: *(.*)')
+
# Patch series tag
re_series = re.compile('^Series-(\w*): *(.*)')
# Handle state transition and skipping blank lines
series_match = re_series.match(line)
commit_match = re_commit.match(line) if self.is_log else None
+ cover_cc_match = re_cover_cc.match(line)
tag_match = None
if self.state == STATE_PATCH_HEADER:
tag_match = re_tag.match(line)
self.in_section = 'cover'
self.skip_blank = False
+ elif cover_cc_match:
+ value = cover_cc_match.group(1)
+ self.AddToSeries(line, 'cover-cc', value)
+
# If we are in a change list, key collected lines until a blank one
elif self.in_change:
if is_blank:
import terminal
# Series-xxx tags that we understand
-valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name'];
+valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',
+ 'cover-cc']
class Series(dict):
"""Holds information about a patch series, including all tags.
def __init__(self):
self.cc = []
self.to = []
+ self.cover_cc = []
self.commits = []
self.cover = None
self.notes = []
value: Tag value (part after 'Series-xxx: ')
"""
# If we already have it, then add to our list
+ name = name.replace('-', '_')
if name in self:
values = value.split(',')
values = [str.strip() for str in values]
print 'Prefix:\t ', self.get('prefix')
if self.cover:
print 'Cover: %d lines' % len(self.cover)
- all_ccs = itertools.chain(*self._generated_cc.values())
+ cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
+ all_ccs = itertools.chain(cover_cc, *self._generated_cc.values())
for email in set(all_ccs):
print ' Cc: ',email
if cmd:
self._generated_cc[commit.patch] = list
if cover_fname:
- print >>fd, cover_fname, ', '.join(set(all_ccs))
+ cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
+ print >>fd, cover_fname, ', '.join(set(cover_cc + all_ccs))
fd.close()
return fname