Skip to content

Instantly share code, notes, and snippets.

@dshimy
Created March 15, 2016 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dshimy/f6be22d61564adb349dc to your computer and use it in GitHub Desktop.
Save dshimy/f6be22d61564adb349dc to your computer and use it in GitHub Desktop.
git stats
#!/bin/bash
IFS=$'\n'
names=`git log --no-merges --all --since="3 months ago" --format='%aN' | sort -u`
printf "%-20s %10s %10s %10s\n" "Name" "Chng Files" "Lns Insert" "Lns Delete"
printf "%-20s %10s %10s %10s\n" "--------------------" "----------" "----------" "----------"
for n in ${names}; do
gitstat=`git log --no-merges --all --shortstat --since="3 months ago" --author="${n}" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {printf "%10s %10s %10s", files, inserted, deleted }'`
name=`printf "%-20s" ${n}`
echo "${name} ${gitstat}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment