Git hooks for better pivotal integration:
pre-commit
:- prevents commiting on a branch that is not suffixed by an issue number. Some special branches (
develop
,master
) andhotfix
es are not constrained - [optional] lints python/js (+ beautification) files (requires to define the
AUTO_LINT_FILES
environment variable)
- prevents commiting on a branch that is not suffixed by an issue number. Some special branches (
prepare-commit-msg
: prepend issue number to commit message if it's missing and if it is set in the branch name (seepre-commit
hook)post-checkout
: [optional] automatically update submodules when checkouting a branch (requires to define theAUTO_SUBMODULE_UPDATE
environment variable)
For easy setup:
current="$( pwd )" && cd "$( git rev-parse --show-cdup )" && if [ -d .hooks ]; then cd .hooks && git fetch origin && git reset --hard origin/master && cd ..; else git clone https://gist.github.com/7358077.git .hooks; fi && if ([ ! -f .gitignore ] || ! grep .hooks .gitignore >/dev/null ); then echo -e ".hooks\n" >> .gitignore; fi && find .hooks -maxdepth 1 -type f |