Created
August 10, 2012 02:37
-
-
Save jcromartie/3310475 to your computer and use it in GitHub Desktop.
bad-habit-breaking git pre-commit hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # A hook to prevent usage of the bad habit: commit -a | |
| # | |
| if ( ps -o pid,command | grep -q "${PPID} git commit -\w*a\w*" ) | |
| then | |
| echo "please do not use \"commit -a\"" | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment