diff options
| author | Teddy Wing | 2015-09-29 18:39:57 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-09-29 18:39:57 -0400 |
| commit | a1c2ba57908329214b90dea64500c937150458a5 (patch) | |
| tree | 201307169e693a883f2e6f3dc19cdc7ec5be7620 | |
| parent | 1190ae67efa2fab3fee81708dece53d9e5a90486 (diff) | |
| download | git-stats-a1c2ba57908329214b90dea64500c937150458a5.tar.bz2 | |
git-stats.sh: Use `--use-mailmap` flag
Add this flag to our `git log` calls in order to recognise mapped
contributors and properly calculate their commit word count and commit
days count.
| -rwxr-xr-x | git-stats.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-stats.sh b/git-stats.sh index cbb45cd..7f05feb 100755 --- a/git-stats.sh +++ b/git-stats.sh @@ -33,14 +33,14 @@ 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' + colon_separated_commit_word_count+=$name:$(git log --pretty='format:%B' --no-merges --author="$name" --use-mailmap | wc -w | tr -d '[[:space:]]')$'\n' done echo -n "$colon_separated_commit_word_count" | asciigraph -l 'Commit message word count' --color --sort=dec while read -r name; do - first_commit_date=$(git --no-pager log --reverse --pretty='format:%ad' --author=""$name"" | head -n 1) + first_commit_date=$(git --no-pager log --reverse --pretty='format:%ad' --author=""$name"" --use-mailmap | head -n 1) days_since_first_commit=$(ruby -e 'require "date"; date = Date.parse("'$first_commit_date'"); puts (Date.today - date).to_i') colon_separated_days_since_first_commit+=$name:$days_since_first_commit$'\n' done <<< "$contributors" |
