Browse Source

Call practracker from pre-push and pre-commit hooks

rl1987 5 years ago
parent
commit
a85cd5b41b
2 changed files with 10 additions and 0 deletions
  1. 4 0
      scripts/git/pre-commit.git-hook
  2. 6 0
      scripts/git/pre-push.git-hook

+ 4 - 0
scripts/git/pre-commit.git-hook

@@ -39,3 +39,7 @@ fi
 if test -e scripts/maint/checkIncludes.py; then
     python scripts/maint/checkIncludes.py
 fi
+
+if [ -e scripts/maint/practracker/practracker.py ]; then
+  python3 ./scripts/maint/practracker/practracker.py "$workdir"
+fi

+ 6 - 0
scripts/git/pre-push.git-hook

@@ -34,6 +34,12 @@ if [ -x "$workdir/.git/hooks/pre-commit" ]; then
   fi
 fi
 
+if [ -e scripts/maint/practracker/practracker.py ]; then
+  if ! python3 ./scripts/maint/practracker/practracker.py "$workdir"; then
+    exit 1
+  fi
+fi
+
 # shellcheck disable=SC2034
 while read -r local_ref local_sha remote_ref remote_sha
 do