X140Yu
9/16/2017 - 11:29 AM

A shell script which helps you calculate a specific person's contribution

A shell script which helps you calculate a specific person's contribution

#!/bin/sh

if [ "$#" -ne 1 ]; then
  echo "Usage: $0 Author-Name"
  exit 1
fi

echo Total Commit: $(git log --author=$1 --pretty=tformat: --oneline | wc -l)

git log --author=$1 --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "Added lines: %s, Removed lines: %s, Total lines: %s\n", add, subs, loc }'