#!/usr/bin/env bash # Pre-push hook: run checks on commits being pushed # # Install with: git config core.hooksPath hooks HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)" run_check() { bash "$HOOKS_DIR/checks/$1" || exit 1 } while read -r local_ref local_oid remote_ref remote_oid; do if [ "$local_oid" = "0000000000000000000000000000000000000000" ]; then continue fi if [ "$remote_oid" = "0000000000000000000000000000000000000000" ]; then export PUSH_RANGE="$local_oid --not --remotes" export PUSH_REMOTE_OID="" else export PUSH_RANGE="$remote_oid..$local_oid" export PUSH_REMOTE_OID="$remote_oid" fi run_check no-modify-pushed-ebuilds.sh run_check pkgcheck-commits.sh done