From b20f15e794eb415ab6034f609399330793ed5e77 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Mon, 3 Nov 2014 10:10:31 +0100 Subject: [PATCH] More stable author email extraction. The email search regular expression in the git-blame output can be tripped by a similar pattern appearing in the source code. The supplied patch fixes the problem. Signed-off-by: Adam Waldenberg --- gitinspector/blame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitinspector/blame.py b/gitinspector/blame.py index b012be1..0f37b7f 100644 --- a/gitinspector/blame.py +++ b/gitinspector/blame.py @@ -143,8 +143,8 @@ class Blame: @staticmethod def get_author_email(string): - author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string) - return author_email.group(1).strip().lstrip("<").rstrip(">") + author_email = re.search("^[0-9a-f]{8} \(<([^>]*)", string) + return author_email.group(1) @staticmethod def get_content(string):