Simple pre-commit hook to block commits if you haven't paired in the last 9 hours.
- Add the correct path to your .gitconfig file on line 5
- Put the script in your repo's .git/hooks/ directory
Built at Pivotal Labs
Simple pre-commit hook to block commits if you haven't paired in the last 9 hours.
Built at Pivotal Labs
#!/bin/sh | |
# | |
# pre-commit hook to force running git-pair at least once per working day | |
# | |
export `stat -s <PATH TO .gitconfig>` | |
let now_time=(`date +%s`) | |
let diff=(now_time - st_mtime) | |
let hours=(diff/3600) | |
if [ $hours -gt 9 ] | |
then | |
echo "You need to pair!!" | |
exit 1 | |
fi |