From af5e9a58506d0d99a8ca9de136f29344cff7f1c7 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 23 Oct 2024 23:54:46 +0200 Subject: [PATCH] show amount of W-I-P commits --- .githooks/pre-push | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index bfc1620..b3eabed 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,13 +1,14 @@ #!/bin/bash wips=$(git log --oneline --no-decorate | grep -i wip ) +wips_n=$(echo "$wips" | wc -l) if [[ -n "$wips" ]]; then # Allows us to read user input below, assigns stdin to keyboard exec < /dev/tty - echo "contains WIP commit" + echo "contains $wips_n WIP commit(s)" read -p "Really push? (Y/N)" -n 1 -r - case "$REPLY" in + case "$REPLY" in y|Y ) echo "continuing...";; * ) echo "aborting."; exit 1;; esac