Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: infra/tools/antibody/git_commit_parser.py

Issue 1235373004: Added script to generate stats on a git checkout (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@new_antibody_db_schema
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: infra/tools/antibody/git_commit_parser.py
diff --git a/infra/tools/antibody/git_commit_parser.py b/infra/tools/antibody/git_commit_parser.py
index d126654b672d77f3c14b1e6d9759d38bf1c2266a..02df5998608146d10696979beff1193ef6a8b0f0 100644
--- a/infra/tools/antibody/git_commit_parser.py
+++ b/infra/tools/antibody/git_commit_parser.py
@@ -21,6 +21,7 @@ def read_commit_info(git_checkout_path, commits_after_date,
Args:
git_checkout_path(str): path to a local git checkout
git_log_format(str): formatting directives passed to git log --format
+
Return:
log(str): output of git log
"""
@@ -65,12 +66,18 @@ def get_bug_url(git_line):
def get_tbr(git_line):
tbr = None
- if git_line.startswith('TBR=') and len(git_line) > 4:
- tbr = git_line[4:]
- tbr = [x.strip() for x in tbr.split(',')]
+ if git_line.startswith('TBR='):
+ if len(git_line) > 4:
+ tbr = git_line[4:]
+ tbr = [x.strip() for x in tbr.split(',')]
+ else:
+ tbr = ['NOBODY']
return tbr
+# TODO(keelerh): figure out how to parse existence of a review url if
+# not prefaced by any indicator (because review urls for other commits
+# appear in the commit message frequently for reverts and references)
def get_review_url(git_line):
review_url = None
if re.match(r'^Review:.+$', git_line):
« infra/tools/antibody/compute_stats.py ('K') | « infra/tools/antibody/compute_stats.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698