bisect-kit: do not break when show commit log of bisect candidates
Since showing only commit id without message is still helpful, do not
fail entirely if 'git log' failed no matter whatever reasons. The real
fix to the original issue will be a separate CL.
BUG=chromium:904277
TEST=see detail in bug: ./bisect_cr_localbuild_internal.py view
Change-Id: I5a801d794c5c602e5ad6ff289553c747e3982471
Reviewed-on: https://chromium-review.googlesource.com/1331115
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
diff --git a/bisect_kit/codechange.py b/bisect_kit/codechange.py
index 6ff23f9..30950df 100644
--- a/bisect_kit/codechange.py
+++ b/bisect_kit/codechange.py
@@ -17,6 +17,7 @@
import os
import re
import shutil
+import subprocess
from bisect_kit import cli
from bisect_kit import errors
@@ -344,7 +345,12 @@
def summary(self, code_storage):
git_root = code_storage.cached_git_root(self.repo_url)
- summary = git_util.get_commit_log(git_root, self.rev).splitlines()[0]
+ try:
+ summary = git_util.get_commit_log(git_root, self.rev).splitlines()[0]
+ except subprocess.CalledProcessError:
+ logger.warning('failed to get commit log of %s at %s', self.rev[:10],
+ git_root)
+ summary = '(unknown)'
return 'commit %s %s %r' % (self.rev[:10], self.path, summary)