diff --git a/src/gitchangelog/gitchangelog.py b/src/gitchangelog/gitchangelog.py index 1f80d3e..2036550 100755 --- a/src/gitchangelog/gitchangelog.py +++ b/src/gitchangelog/gitchangelog.py @@ -774,6 +774,13 @@ def authors(self): co_authors = getattr(self, 'trailer_co_authored_by', []) co_authors = co_authors if isinstance(co_authors, list) else [co_authors] return sorted(co_authors + ["%s <%s>" % (self.author_name, self.author_email)]) + + @property + def author_github(self): + if not self.author_email: + return "" + sub = re.search("\+(.*?)\@", self.author_email) + return sub.group(1) if sub else "" @property def date(self): @@ -1174,7 +1181,7 @@ def rest_title(label, char="="): def render_version(version): title = ( - "%s (%s)" % (version["tag"], version["date"]) + "[%s] - %s" % (version["tag"], version["date"]) if version["tag"] else opts["unreleased_version_label"] ) @@ -1231,7 +1238,7 @@ def mustache(template_name): def stuffed_versions(versions, opts): for version in versions: title = ( - "%s (%s)" % (version["tag"], version["date"]) + "[%s] - %s" % (version["tag"], version["date"]) if version["tag"] else opts["unreleased_version_label"] ) @@ -1480,6 +1487,7 @@ def versions_data_iter( { "author": commit.author_name, "authors": commit.author_names, + "author_github": commit.author_github, "subject": subject_process(commit.subject), "body": body_process(commit.body), "commit": commit,