home/.githooks/pre-push

15 lines
336 B
Bash
Executable File

#!/bin/bash
wips=$(git log --oneline --no-decorate | grep -i wip )
if [[ -n "$wips" ]]; then
# Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty
echo "contains WIP commit"
read -p "Really push? (Y/N)" -n 1 -r
case "$REPLY" in
y|Y ) echo "continuing...";;
* ) echo "aborting."; exit 1;;
esac
fi