show amount of W-I-P commits

This commit is contained in:
Christoph J. Scherr 2024-10-23 23:54:46 +02:00
parent f461e4ac4d
commit af5e9a5850
1 changed files with 3 additions and 2 deletions

View File

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