Created
August 13, 2021 17:22
-
-
Save jfollmann/5de0713c62d8a4a2381154601decd74a to your computer and use it in GitHub Desktop.
Show git repository contribs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env zsh | |
team_total=$(git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, |bc -l|awk '{sum+=$1}END{print sum}'); | |
tmp_counter='/tmp/counter.txt'; | |
tmp_user='/tmp/users.txt'; | |
tmp_percentage='/tmp/counters_users' | |
# if you are running this again it make the file empty or you can rm it | |
rm $tmp_percentage $tmp_user $tmp_counter | |
git shortlog -s -n |sed 's/\t/,/g'|cut -f2 -d, >>$tmp_user; | |
git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, >>$tmp_counter; | |
cat $tmp_counter | while read LINE; do | |
printf '%.2f %% \n' $(echo \($LINE/$team_total\)\*100 |bc -l ) >>$tmp_percentage | |
done | |
echo 'commits % | contributor | # of commits';paste $tmp_percentage $tmp_user $tmp_counter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment