Don't spam stdout when `git describe` fails.

Currently, a successful Chrome build always prints something like:

  Failed to run "['git', 'describe']" in
  ".../src/third_party/swiftshader/third_party/SPIRV-Tools":
  fatal: No names found, cannot describe anything.

However, it is expected that this command may fail when trying to update
the build version. Don't spam stdout because there's a fallback and this
is not actually a fatal error.

Bug: chromium:1475701
Change-Id: Ie0234b6a6862c9de67246f89333eaa37bdafde1f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/72288
Commit-Queue: Geoff Lang <geofflang@google.com>
Tested-by: Geoff Lang <geofflang@google.com>
Reviewed-by: Geoff Lang <geofflang@google.com>
diff --git a/third_party/SPIRV-Tools/utils/update_build_version.py b/third_party/SPIRV-Tools/utils/update_build_version.py
index 5a78ada..0ee5c08 100755
--- a/third_party/SPIRV-Tools/utils/update_build_version.py
+++ b/third_party/SPIRV-Tools/utils/update_build_version.py
@@ -59,12 +59,14 @@
         else:
             raise
 
-def command_output(cmd, directory):
+def command_output(cmd, directory, may_fail=False):
     """Runs a command in a directory and returns its standard output stream.
 
     Captures the standard error stream.
 
-    Raises a RuntimeError if the command fails to launch or otherwise fails.
+    Raises a RuntimeError if the command fails to launch or otherwise fails. If
+    `may_fail` is true, suppresses the log message when running the command
+    succeeds but returns a non-zero error code.
     """
     try:
       # Set shell=True on Windows so that Chromium's git.bat can be found when
@@ -75,7 +77,7 @@
                            stderr=subprocess.PIPE,
                            shell=os.name == 'nt')
       (stdout, stderr) = p.communicate()
-      if p.returncode != 0:
+      if p.returncode != 0 and not may_fail:
         logging.error('Failed to run "{}" in "{}": {}'.format(cmd, directory, stderr.decode()))
     except Exception as e:
         logging.error('Failed to run "{}" in "{}": {}'.format(cmd, directory, str(e)))
@@ -111,7 +113,7 @@
     Runs 'git describe', or alternately 'git rev-parse HEAD', in directory.  If
     successful, returns the output; otherwise returns 'unknown hash, <date>'."""
 
-    success, output = command_output(['git', 'describe'], repo_path)
+    success, output = command_output(['git', 'describe'], repo_path, may_fail=True)
     if not success:
       output = command_output(['git', 'rev-parse', 'HEAD'], repo_path)