Created
May 2, 2012 13:48
-
-
Save rpq/2576630 to your computer and use it in GitHub Desktop.
git pre-commit hook: white space check
This file contains 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
52 WHITESPACE_CHECK=`git status | grep modified | awk -F" " '{print $3}' | xargs -I '{}' grep -nPH "^[ ]+$" '{}'` | |
53 WHITESPACE_CHECK_COUNT=`echo "$WHITESPACE_CHECK" | wc -w` | |
54 if [ "$WHITESPACE_CHECK_COUNT" != "0" ]; then | |
55 echo "$WHITESPACE_CHECK" | xargs -I '{}' echo ">> git pre-commit hook: white space in {}" | |
56 exit 1 | |
57 fi |
Author
rpq
commented
Aug 15, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment