Skip to content

Instantly share code, notes, and snippets.

@rctay
Created June 22, 2012 16:05
Show Gist options
  • Save rctay/2973715 to your computer and use it in GitHub Desktop.
Save rctay/2973715 to your computer and use it in GitHub Desktop.
[git,django,south] hook to warn about migrations from merges
#!/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
#!/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