aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-04-16 08:09:20 -0400
committerNick Mathewson <nickm@torproject.org>2019-04-16 08:09:20 -0400
commit82b690d7da7951bde0238c440139e62e983a0a84 (patch)
tree7da0cce44cb7349bc2332ab6cc971bd6294ef178
parent7b2357a37ab0c0293aad3eb185414f086bbe44d9 (diff)
parente8e6931638a14a2c996e55d7c8342654fb546b34 (diff)
downloadtor-82b690d7da7951bde0238c440139e62e983a0a84.tar.gz
tor-82b690d7da7951bde0238c440139e62e983a0a84.zip
Merge remote-tracking branch 'tor-github/pr/910'
-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