[PATCH] D80978: Add a git hook script that can be manually setup to run some checks on every push

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 13:14:31 PDT 2020


mehdi_amini marked 3 inline comments as done.
mehdi_amini added inline comments.


================
Comment at: llvm/utils/git/pre-push.py:91
+def shell(cmd, strip=True, cwd=None, stdin=None, die_on_failure=True,
+          ignore_errors=False, text=True, print_raw_stderr=False):
+    # Escape args when logging for easy repro.
----------------
MaskRay wrote:
> Are print_raw_stderr and ignore_errors and probably other arguments really used?
I forked the whole file from the former `git-llvm` script we had in tree :)


================
Comment at: llvm/utils/git/pre-push.py:116
+        if strip:
+            if text:
+                stdout = stdout.rstrip('\r\n')
----------------
MaskRay wrote:
> `text` is always True. The other code path can be dropped.
this function as-is is reusable: I could strip it down the bare minimum needed in this script, but since it already existed before...


================
Comment at: llvm/utils/git/pre-push.py:137
+
+def program_exists(cmd):
+    if sys.platform == 'win32' and not cmd.endswith('.exe'):
----------------
MaskRay wrote:
> shutil.which
Does it handle the `.exe` suffix addition here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80978/new/

https://reviews.llvm.org/D80978





More information about the llvm-commits mailing list