Debian Codegraph @

devel-tools/git-pre-push-hook

raw
1 #!/bin/sh
2 #
3 # A pre-push hook that makes sure all testing/external changes
4 # have been pushed already. If not, it will abort. Note that
5 # it will only check for unpushed commits, not for uncommited
6 # changes.
7 #
8 # To install this, copy it into you Bro tree's .git/hooks/pre-push.
9 #
10 # This hook is called with the following parameters:
11 #
12 # $1 -- Name of the remote to which the push is being done
13 # $2 -- URL to which the push is being done
14 #
15 # If this script exits with a non-zero status nothing will be pushed.
16
17 test -d testing/external || exit 0
18
19 cd testing/external
20
21 base=`pwd`
22 abort=0
23
24 for repo in `./scripts/find-git-repos`; do
25 cd ${base}/${repo} && \
26 git rev-list @{u}.. | grep -q . && \
27 echo "ERROR: testing/external/`basename $repo` has commits that are not pushed." && \
28 abort=1
29 done
30
31 exit ${abort}