From 7efba995e3026c16dd8b5decf3eece940098da7f Mon Sep 17 00:00:00 2001
From: Dimitris Lampridis <dimitris.lampridis@cern.ch>
Date: Mon, 17 Feb 2020 15:09:04 +0100
Subject: [PATCH] [tools] gen_buildinfo.py: do not fail if git log or git
 config fail.

---
 tools/gen_buildinfo.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/gen_buildinfo.py b/tools/gen_buildinfo.py
index d01b7829..4e4a900e 100644
--- a/tools/gen_buildinfo.py
+++ b/tools/gen_buildinfo.py
@@ -3,10 +3,16 @@
 with open("buildinfo_pkg.vhd", "w") as f:
   import subprocess
   import time
-  commitid = subprocess.check_output(
+  try:
+    commitid = subprocess.check_output(
       ["git", "log", "-1", "--format=%H"]).decode().strip()
-  userid = subprocess.check_output(
+  except:
+    commitid = "unknown"
+  try:
+    userid = subprocess.check_output(
       ["git", "config", "--get", "user.name"]).decode().strip()
+  except:
+    userid = "unknown"
   if action == "simulation":
       top = sim_top
       tool = sim_tool
-- 
GitLab