diff options
| -rwxr-xr-x | git-stats.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/git-stats.sh b/git-stats.sh index 540e1ab..450817b 100755 --- a/git-stats.sh +++ b/git-stats.sh @@ -19,10 +19,21 @@ cd $GIT_REPO shortlog=$(git shortlog -ns --no-merges) -echo "$shortlog" | awk '{ +colon_separated_shortlog=$(echo "$shortlog" | awk '{ for (i = 2; i <= NF; i++) { printf "%s", $i if (i != NF) printf " " } printf ":%s\n", $1 -}' | asciigraph -l "Commit count" --color +}') + +echo "$colon_separated_shortlog" | asciigraph -l 'Commit count' --color + + +contributors=$(echo "$colon_separated_shortlog" | cut -d: -f 1) + +for name in $contributors; do + colon_separated_commit_word_count+=$name:$(git log --pretty='format:%B' --no-merges --author="$name" | wc -w | tr -d '[[:space:]]')$'\n' +done + +echo -n "$colon_separated_commit_word_count" | asciigraph -l 'Commit message word count' --color --sort=dec |
