dont easily push W-I-P commit

This commit is contained in:
Christoph J. Scherr 2024-10-23 23:32:12 +02:00
parent d5236bca30
commit f461e4ac4d
2 changed files with 16 additions and 0 deletions

14
.githooks/pre-push Executable file
View File

@ -0,0 +1,14 @@
#!/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

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
!.zprofile !.zprofile
!.vimrc !.vimrc
!.ideavimrc !.ideavimrc
!.githooks
!.githooks/**
!.config !.config
!.config/nvim !.config/nvim
!.config/nvim/** !.config/nvim/**