From 30445ebd68810e4117d0bb0e82342104115d9b0d Mon Sep 17 00:00:00 2001
From: Andreas Antener <antener_a@gmx.ch>
Date: Mon, 12 Dec 2016 21:36:55 +0100
Subject: [PATCH] log upload: ignore error if we cannot get git email, really
 be quiet with -q except for printing the URL in the end

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

diff --git a/Tools/upload_log.py b/Tools/upload_log.py
index ffd9665101..e180f7115c 100755
--- a/Tools/upload_log.py
+++ b/Tools/upload_log.py
@@ -50,7 +50,11 @@ def ask_value(text, default=None):
 
 def get_git_email():
     """ get (globally) configured git email """
-    output = subprocess.check_output(["git", "config", "--global", "user.email"])
+    try:
+        output = subprocess.check_output(["git", "config", "--global", "user.email"])
+    except Exception:
+        return ""
+
     return output.decode("utf-8").replace('\n', '')
 
 
@@ -92,7 +96,9 @@ def main():
             'feedback': feedback, 'email': email}
 
     for file_name in args.FILE:
-        print('Uploading '+file_name+'...')
+        if not quiet:
+            print('Uploading '+file_name+'...')
+
         with open(file_name, 'rb') as f:
             r = requests.post(UPLOAD_URL, data=payload, files={'filearg': f},
                     allow_redirects=False)
-- 
GitLab