Ignore commits that have no author email

Git requires email and name to set properly. These fields can be empty only in old (pre-Essex) commits.

Closes bug 1240081

Change-Id: I139d001b28c23bea83651667f9a7ae075a1ac332
This commit is contained in:
Ilya Shakhat
2013-10-15 17:47:33 +04:00
parent c38c2d88f3
commit 4d3eef373d
2 changed files with 7 additions and 1 deletions

View File

@@ -50,7 +50,9 @@ def week_to_date(week):
def check_email_validity(email):
return re.match(r'[\w\d_\.-]+@([\w\d_\.-]+\.)+[\w]+', email)
if email:
return re.match(r'[\w\d_\.-]+@([\w\d_\.-]+\.)+[\w]+', email)
return False
def read_uri(uri):

View File

@@ -20,6 +20,7 @@ import re
import sh
from stackalytics.openstack.common import log as logging
from stackalytics.processor import utils
LOG = logging.getLogger(__name__)
@@ -149,6 +150,9 @@ class Git(Vcs):
commit[param[0]] = unicode(rec.group(i), 'utf8')
i += 1
if not utils.check_email_validity(commit['author_email']):
continue
commit['files_changed'] = int(rec.group(i))
i += 1
lines_changed_group = rec.group(i)