summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1d1485c)
This variable is expanded in the e-mail templates on the 'From:'
header line. It replaces the current 'maintainer' variable. This code
will undergo some reworking as there are pending patches affecting it.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
#commname: Your Name
#commemail: your.name@yourcompany.com
#commname: Your Name
#commemail: your.name@yourcompany.com
+# E-mail sender (added to the "From: " header)
+#sender: Your Name <your.name@yourcompany.com>
+
# Automatically Bcc the address below
#autobcc: your.name@yourcompany.com
# Automatically Bcc the address below
#autobcc: your.name@yourcompany.com
The patch e-mail template accepts the following variables:
%(patch)s - patch name
The patch e-mail template accepts the following variables:
%(patch)s - patch name
- %(maintainer)s - 'authname <authemail>' as read from the config file
+ %(sender)s - 'sender' or 'authname <authemail>' as per the config file
%(shortdescr)s - the first line of the patch description
%(longdescr)s - the rest of the patch description, after the first line
%(diff)s - unified diff of the patch
%(shortdescr)s - the first line of the patch description
%(longdescr)s - the rest of the patch description, after the first line
%(diff)s - unified diff of the patch
%(patchnr)s - patch number
%(totalnr)s - total number of patches to be sent
%(number)s - empty if only one patch is sent or ' patchnr/totalnr'
%(patchnr)s - patch number
%(totalnr)s - total number of patches to be sent
%(number)s - empty if only one patch is sent or ' patchnr/totalnr'
- %(fromauth)s - 'From: author\\n\\n' if different from maintainer
+ %(fromauth)s - 'From: author\\n\\n' if different from sender
%(authname)s - author's name
%(authemail)s - author's email
%(authdate)s - patch creation date
%(commname)s - committer's name
%(commemail)s - committer's e-mail
%(authname)s - author's name
%(authemail)s - author's email
%(authdate)s - patch creation date
%(commname)s - committer's name
%(commemail)s - committer's e-mail
-For the preamble e-mail template, only the %(maintainer)s,
-%(version)s, %(patchnr)s, %(totalnr)s and %(number)s variables are
-supported."""
+For the preamble e-mail template, only the %(sender)s, %(version)s,
+%(patchnr)s, %(totalnr)s and %(number)s variables are supported."""
options = [make_option('-a', '--all',
help = 'e-mail all the applied patches',
options = [make_option('-a', '--all',
help = 'e-mail all the applied patches',
"""Return the 'authname <authemail>' string as read from the
configuration file
"""
"""Return the 'authname <authemail>' string as read from the
configuration file
"""
- if config.has_option('stgit', 'authname') \
- and config.has_option('stgit', 'authemail'):
+ if config.has_option('stgit', 'sender'):
+ return config.get('stgit', 'sender')
+ elif config.has_option('stgit', 'authname') \
+ and config.has_option('stgit', 'authemail'):
return '%s <%s>' % (config.get('stgit', 'authname'),
config.get('stgit', 'authemail'))
else:
return '%s <%s>' % (config.get('stgit', 'authname'),
config.get('stgit', 'authemail'))
else:
+ raise CmdException, 'unknown sender details'
def __parse_addresses(addresses):
"""Return a two elements tuple: (from, [to])
def __parse_addresses(addresses):
"""Return a two elements tuple: (from, [to])
def __build_cover(tmpl, total_nr, msg_id, options):
"""Build the cover message (series description) to be sent via SMTP
"""
def __build_cover(tmpl, total_nr, msg_id, options):
"""Build the cover message (series description) to be sent via SMTP
"""
- maintainer = __get_maintainer()
- if not maintainer:
- maintainer = ''
+ sender = __get_sender()
if options.version:
version_str = ' %s' % options.version
if options.version:
version_str = ' %s' % options.version
- tmpl_dict = {'maintainer': maintainer,
+ tmpl_dict = {'sender': sender,
+ # for backward template compatibility
+ 'maintainer': sender,
# for backward template compatibility
'endofheaders': '',
# for backward template compatibility
# for backward template compatibility
'endofheaders': '',
# for backward template compatibility
commname = p.get_commname();
commemail = p.get_commemail();
commname = p.get_commname();
commemail = p.get_commemail();
- maintainer = __get_maintainer()
- if not maintainer:
- maintainer = '%s <%s>' % (commname, commemail)
+ sender = __get_sender()
fromauth = '%s <%s>' % (authname, authemail)
fromauth = '%s <%s>' % (authname, authemail)
- if fromauth != maintainer:
fromauth = 'From: %s\n\n' % fromauth
else:
fromauth = ''
fromauth = 'From: %s\n\n' % fromauth
else:
fromauth = ''
number_str = ''
tmpl_dict = {'patch': patch,
number_str = ''
tmpl_dict = {'patch': patch,
- 'maintainer': maintainer,
+ 'sender': sender,
+ # for backward template compatibility
+ 'maintainer': sender,
'shortdescr': short_descr,
'longdescr': long_descr,
# for backward template compatibility
'shortdescr': short_descr,
'longdescr': long_descr,
# for backward template compatibility
Subject: [%(prefix)sPATCH%(version)s%(number)s] Series short description
The following series implements...
Subject: [%(prefix)sPATCH%(version)s%(number)s] Series short description
The following series implements...
Subject: [%(prefix)sPATCH%(version)s%(number)s] %(shortdescr)s
%(fromauth)s%(longdescr)s
Subject: [%(prefix)sPATCH%(version)s%(number)s] %(shortdescr)s
%(fromauth)s%(longdescr)s