Browse Source

Merge branch 'count-commits' into 'main'

Add count commits script

See merge request fdai7381/pmuw-project!1
main
fdai7451 2 years ago
parent
commit
eaca761b50
  1. 12
      count-commits.sh

12
count-commits.sh

@ -0,0 +1,12 @@
#!/bin/bash
total_commits=$(git shortlog -s -n | awk '{ sum += $1; } END { print sum; }' "$@")
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 "Commits per user:"
git shortlog -s -e | sed 's/<//;s/>//' | awk '{ printf "\t%s (%s): %s\n", $2, $3, $1 }'
Loading…
Cancel
Save