diff --git a/stackalytics/processor/vcs.py b/stackalytics/processor/vcs.py index b726f207a..adedb8a65 100644 --- a/stackalytics/processor/vcs.py +++ b/stackalytics/processor/vcs.py @@ -65,7 +65,8 @@ GIT_LOG_PATTERN = re.compile(''.join([(r[0] + ':(.*?)\n') 'diff_stat:' + DIFF_STAT_PATTERN, re.DOTALL) -CO_AUTHOR_PATTERN_RAW = '(?P.+?)\s*<(?P.+)>' +CO_AUTHOR_PATTERN_RAW = ('(?P.+?)\s*' + '[\w\.-]+@[\w\.-]+)>?') CO_AUTHOR_PATTERN = re.compile(CO_AUTHOR_PATTERN_RAW, re.IGNORECASE) MESSAGE_PATTERNS = { diff --git a/tests/unit/test_vcs.py b/tests/unit/test_vcs.py index d59a3e010..3a61bf80c 100644 --- a/tests/unit/test_vcs.py +++ b/tests/unit/test_vcs.py @@ -112,6 +112,7 @@ message:Change-Id: Id811c762ec1d13992b306c4a38e7360575e61451 Co-Authored-By: Tupac Shakur Also-By: Bob Dylan Also-By: Anonymous +Also-By: Winnie the Pooh winnie222@openstack.org diff_stat: @@ -159,3 +160,8 @@ diff_stat: {'author_name': 'Bob Dylan', 'author_email': 'bob.dylan@openstack.com'}, commits[5]['coauthor']) + + self.assertIn( + {'author_name': 'Winnie the Pooh', + 'author_email': 'winnie222@openstack.org'}, + commits[5]['coauthor'])