fix mention of full name when pushing tags

This commit is contained in:
Frédéric Péters 2017-04-26 10:53:59 +02:00
parent 2917c7c674
commit 2f566af44d
1 changed files with 4 additions and 3 deletions

View File

@ -113,16 +113,17 @@ class RefChange(object):
raise NotImplementedError()
def generate_header(self, out, subject, include_revs=True, oldrev=None, newrev=None, cc=None):
email_user_fullname = user_fullname
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]
email_user_fullname = 'git+' + emails[0]
user = os.environ['USER']
if user_fullname:
from_address = "%s <%s@entrouvert.com>" % (user_fullname, user)
if email_user_fullname:
from_address = "%s <%s@entrouvert.com>" % (email_user_fullname, user)
else:
from_address = "%s@entrouvert.com" % (user)