aboutsummaryrefslogtreecommitdiff
path: root/contrib/verify-commits/pre-push-hook.sh
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2014-10-27 00:07:25 -0700
committerMatt Corallo <git@bluematt.me>2014-12-20 00:39:42 -0500
commitadaa568722e59cde510c5fe1997c49cbb9d7db12 (patch)
treed392d4c3467c229e54d19c835c9bd497e6917aff /contrib/verify-commits/pre-push-hook.sh
parent13c077c7cfe9f367c721f3d99924b3d568afb4d0 (diff)
downloadbitcoin-adaa568722e59cde510c5fe1997c49cbb9d7db12.tar.xz
Add script to verify all merge commits are signed
Diffstat (limited to 'contrib/verify-commits/pre-push-hook.sh')
-rwxr-xr-xcontrib/verify-commits/pre-push-hook.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/verify-commits/pre-push-hook.sh b/contrib/verify-commits/pre-push-hook.sh
new file mode 100755
index 0000000000..607c0cac45
--- /dev/null
+++ b/contrib/verify-commits/pre-push-hook.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+if ! [[ "$2" =~ [git@]?[www.]?github.com[:|/]bitcoin/bitcoin[.git]? ]]; then
+ exit 0
+fi
+
+while read LINE; do
+ set -- A $LINE
+ if [ "$4" != "refs/heads/master" ]; then
+ continue
+ fi
+ if ! ./contrib/verify-commits/verify-commits.sh $3 > /dev/null 2>&1; then
+ echo "ERROR: A commit is not signed, can't push"
+ ./contrib/verify-commits/verify-commits.sh
+ exit 1
+ fi
+done < /dev/stdin