[llvm] [AIX] Add git revision to .file string (PR #88164)

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 13:15:11 PDT 2024


================
@@ -1,4 +1,18 @@
 if not "PowerPC" in config.root.targets:
     config.unsupported = True
 
+import subprocess
+
 config.suffixes.add(".py")
+
+def get_revision(repo_path):
+  cmd = ['git', '-C', repo_path, 'rev-parse', 'HEAD']
+  return subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('ascii')
----------------
daltenty wrote:



This should check whether the git invocation was successful some how

(try check=True and propagate the exception to the caller: https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError)

https://github.com/llvm/llvm-project/pull/88164


More information about the llvm-commits mailing list