From 51b1ee991f10bb69a4309f83eea31e71fad7b391 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 18 Aug 2015 02:03:21 -0400 Subject: git-stats.sh: Graph total words in commit messages per contributor Count the words in all non-merge commit messages for each contributor and graph the totals. --- git-stats.sh | 15 +++++++++++++-- 1 file 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 -- cgit v1.2.3