Skip to content

Instantly share code, notes, and snippets.

@Snegovikufa
Last active September 25, 2017 12:21
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 Snegovikufa/f0bc8248e5f480d76939937e221a4c96 to your computer and use it in GitHub Desktop.
Save Snegovikufa/f0bc8248e5f480d76939937e221a4c96 to your computer and use it in GitHub Desktop.
Git changed lines per author
#!/bin/sh
git shortlog -sn | awk ' {print $2, $3, $4} ' > names.txt
cat names.txt | while read cn
do
name="$(echo $cn | sed -e 's/\r//g')"
echo $name
git log --no-merges -p -w --shortstat --author="$name" --since="1 Jan, 2017" -p -- . ':(exclude)*.xml' ':(exclude)*.png' ':(exclude)*.g.cs' ':(exclude)*.Designer.cs' ':(exclude)lib/*' ':(exclude)*.csproj' | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print " files changed: ", files, "lines inserted: ", inserted, "lines deleted: ", deleted }'
done
rm names.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment