2 # Git pre-commit hook that runs multiple hooks specified in $HOOKS.
3 # Make sure this script is executable. Bypass hooks with git commit --no-verify.
5 # This file is inspired by a set of unofficial pre-commit hooks available
7 # Link: https://github.com/githubbrowser/Pre-commit-hooks
8 # Contact: David Martin, david.martin.mailbox@googlemail.com
11 ###########################################################
13 # pre-commit hooks to be executed. They should be in the same .git/hooks/ folder
14 # as this script. Hooks should return 0 if successful and nonzero to cancel the
15 # commit. They are executed in the order in which they are listed.
16 ###########################################################
18 HOOKS="scripts/git-hooks/pre-commit.hook scripts/git-hooks/pre-commit-python.hook"
23 if [ "$GST_DISABLE_PRE_COMMIT_HOOKS" = "1" ]
25 echo "Pre-commits hooks disabled by env GST_DISABLE_PRE_COMMIT_HOOKS."
33 echo "Running hook: $hook"
34 # run hook if it exists
35 # if it returns with nonzero exit with 1 and thus abort the commit
36 if [ -f "$PWD/$hook" ]; then
42 echo "Error: file $hook not found."
43 echo "Aborting commit. Make sure the hook is at $PWD/$hook and executable."
44 echo "You can disable it by removing it from the list"
45 echo "You can skip all pre-commit hooks with --no-verify (not recommended)."