include author email in From (#245)
This commit is contained in:
parent
7fc63be7c3
commit
2917c7c674
|
@ -113,6 +113,13 @@ class RefChange(object):
|
|||
raise NotImplementedError()
|
||||
|
||||
def generate_header(self, out, subject, include_revs=True, oldrev=None, newrev=None, cc=None):
|
||||
if include_revs and oldrev and newrev:
|
||||
authors = [x for x in git.show(newrev).splitlines() if x.startswith('Author:')]
|
||||
if authors:
|
||||
author = authors[0]
|
||||
emails = re.findall(r'[A-Za-z0-9\.-]+@[A-Za-z0-9\.-]+', author)
|
||||
user_fullname = 'git+' + emails[0]
|
||||
|
||||
user = os.environ['USER']
|
||||
if user_fullname:
|
||||
from_address = "%s <%s@entrouvert.com>" % (user_fullname, user)
|
||||
|
|
Loading…
Reference in New Issue