#!/bin/bash # use newline as separator IFS=$'\n' for author in $(git log --all --format='%cN' | sort -u); do echo $author; git log --all --author="$author" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "++ %s\n-- %s\n= %s\n", add, subs, loc }' - done # git config --global alias.impact '!sh git-impact.sh'