Created
March 4, 2014 02:21
-
-
Save danieldbower/9339101 to your computer and use it in GitHub Desktop.
Disable -m (message parameter) in git command in bashrc
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
function git { | |
for arg | |
do | |
if [[ $arg == -m* || $arg == -[^-]*m* ]] | |
then | |
annoy_me | |
return 1 | |
fi | |
done | |
command git "$@" | |
} | |
function annoy_me { | |
echo "" | |
echo "" | |
echo "Stop using -m, $USER!" | |
echo "" | |
echo "" | |
echo "You are now in a 3 second time out." | |
echo "" | |
echo "" | |
echo "Try that commit again, and this time use the template" | |
echo "" | |
echo "" | |
settings=$(stty -g) | |
stty raw | |
sleep 3 | |
stty "$settings" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Love this. I found this because I keep using the
-a
parameter without thinking. Need to be more intentional with my commits, thanks for this.