diff --git a/post-receive-email b/post-receive-email index cb0816f..0778cd3 100755 --- a/post-receive-email +++ b/post-receive-email @@ -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)