Last active
August 29, 2015 13:57
-
-
Save Deco/9487472 to your computer and use it in GitHub Desktop.
Git warning on requirements.txt change (save as ".git/hooks/post-merge" and run "chmod +x .git/hooks/post-merge")
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/bash | |
set -eu | |
git diff "HEAD@{1}" --name-only | grep requirements.txt 2>&1 > /dev/null | |
CHANGED=$? | |
if [ $CHANGED ]; then | |
echo | |
echo -e "\e[41m!!! requirements.txt HAS CHANGED !!!\033[0m" | |
echo | |
echo "Run this now:" | |
echo " pip install -r requirements.txt" | |
fi | |
# source: http://blog.daniel-watkins.co.uk/2013/01/git-tip-get-warning-when-file-has.html |
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/bash | |
set -eu | |
git diff "HEAD@{1}" --name-only | grep requirements.txt 2>&1 > /dev/null | |
CHANGED=$? | |
if [ $CHANGED ]; then | |
echo | |
echo -e "\e[41m!!! requirements.txt HAS CHANGED !!!\033[0m" | |
echo | |
echo "Executing \"pip install -r requirements.txt\":" | |
pip install -r requirements.txt | |
fi | |
# source: http://blog.daniel-watkins.co.uk/2013/01/git-tip-get-warning-when-file-has.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment