summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/ticket300334
-rwxr-xr-xscripts/git/pre-push.git-hook7
2 files changed, 11 insertions, 0 deletions
diff --git a/changes/ticket30033 b/changes/ticket30033
new file mode 100644
index 0000000000..3f66d049c8
--- /dev/null
+++ b/changes/ticket30033
@@ -0,0 +1,4 @@
+ o Minor features (developer tooling):
+ - Call pre-commit git hook from pre-push hook to make sure we're
+ running documentation and code style checks before pushing to remote
+ git repository. Implements feature 30033.
diff --git a/scripts/git/pre-push.git-hook b/scripts/git/pre-push.git-hook
index e7a72efa08..f329829346 100755
--- a/scripts/git/pre-push.git-hook
+++ b/scripts/git/pre-push.git-hook
@@ -27,6 +27,13 @@ ref_is_upstream_branch() {
fi
}
+workdir=$(git rev-parse --show-toplevel)
+if [ -x "$workdir/.git/hooks/pre-commit" ]; then
+ if ! "$workdir"/.git/hooks/pre-commit; then
+ exit 1
+ fi
+fi
+
# shellcheck disable=SC2034
while read -r local_ref local_sha remote_ref remote_sha
do