Browse Source

refactoring: rearrange commit script output

main
fdai7451 2 years ago
parent
commit
ca77d79e61
  1. 13
      count-commits.sh

13
count-commits.sh

@ -1,12 +1,13 @@
#!/bin/bash #!/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:" echo "Commits per user:"
for user in $(git shortlog -s | awk '{ print $2 }'); do for user in $(git shortlog -s | awk '{ print $2 }'); do

Loading…
Cancel
Save