aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-08-18 02:03:21 -0400
committerTeddy Wing2015-08-18 02:03:21 -0400
commit51b1ee991f10bb69a4309f83eea31e71fad7b391 (patch)
tree75c6ffbf8ef083dd86b00a1d7cfd687e0c6309f2
parent4de870595c1725490717da6d203df9e8e9304df8 (diff)
downloadgit-stats-51b1ee991f10bb69a4309f83eea31e71fad7b391.tar.bz2
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.
-rwxr-xr-xgit-stats.sh15
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