From 9647ae2178422f5124ab0a825bb9aec8977e6227 Mon Sep 17 00:00:00 2001 From: fdai7451 Date: Tue, 17 Jan 2023 08:59:15 +0100 Subject: [PATCH] refactoring: rearrange commit script output --- count-commits.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/count-commits.sh b/count-commits.sh index 4919117..7389152 100755 --- a/count-commits.sh +++ b/count-commits.sh @@ -1,12 +1,13 @@ #!/bin/bash -total_commits=$(git shortlog -s -n --no-merges | awk '{ sum += $1; } END { print sum; }' "$@") +echo "Requirements:" +echo -e "\tAt least 200 commits" +echo -e "\tAt least 50 commits per user" +echo -e "\tAt least 20% test commits per user" +echo -e "\tAt least 20% refactoring commits per user" +echo -if [[ $total_commits -gt 200 ]]; then - echo "Total commits: $total_commits (minimum required commits reached)" -else - echo "Total commits: $total_commits ($(expr 200 - $total_commits) commits left to reach minimum required commits)" -fi +echo "Total commits: $(git shortlog -s -n --no-merges | awk '{ sum += $1; } END { print sum; }' "$@")" echo "Commits per user:" for user in $(git shortlog -s | awk '{ print $2 }'); do