Skip to content

Instantly share code, notes, and snippets.

@lolli42
Last active August 29, 2015 13:57
Show Gist options
  • Save lolli42/9760217 to your computer and use it in GitHub Desktop.
Save lolli42/9760217 to your computer and use it in GitHub Desktop.
Patches by author since 4.5.0
#!/bin/bash
AUTHOR="$1"
git log --author="$AUTHOR" --since="2011-01-26" --pretty="%h" > ~/foo.txt
PATCHES=`cat ~/foo.txt | wc -l`
while read PATCH; do git log --stat $PATCH^1..$PATCH | tail -n 1; done < ~/foo.txt > ~/foo2.txt
INSERTS=`cat ~/foo2.txt | awk '{s+=$4} END {print s}'`
DELETES=`cat ~/foo2.txt | awk '{s+=$6} END {print s}'`
echo "$AUTHOR had $PATCHES patches merged since 4.5.0 release with $INSERTS inserted lines and $DELETES lines deleted."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment