Created
June 22, 2012 16:05
-
-
Save rctay/2973715 to your computer and use it in GitHub Desktop.
[git,django,south] hook to warn about migrations from merges
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
#!/bin/sh | |
# was it a merge? | |
if test `git rev-list --parents -n 1 HEAD | wc -w` -lt 3; then | |
exit 0; | |
fi | |
if test `git rev-list ^HEAD^1 HEAD^@ -- sq/migrations | wc -l` -gt 0; then | |
echo '#' | |
echo '# WARNING: Migrations detected in merge; you may want to apply them.' | |
echo '#' | |
fi | |
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
#!/bin/sh | |
if test `git rev-list ^HEAD^1 HEAD^@ -- sq/migrations | wc -l` -gt 0; then | |
echo '#' | |
echo '# WARNING: Migrations detected in merge; you may want to apply them.' | |
echo '#' | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment