Skip to content

Instantly share code, notes, and snippets.

@pgampe
Forked from lolli42/Patches by author since 4.5.0
Last active August 29, 2015 13:57
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 pgampe/9761071 to your computer and use it in GitHub Desktop.
Save pgampe/9761071 to your computer and use it in GitHub Desktop.
#!/bin/bash
AUTHOR="$1"
MKTEMP=$(which mktemp)
if [[ -n $MKTEMP ]]; then
TEMP1=$($MKTEMP)
TEMP2=$($MKTEMP)
else
TEMP1="/tmp/$(basename $0).$$.tmp"
TEMP2="/tmp/$(basename $0).$$.2.tmp"
fi
git log --author="$AUTHOR" --since="2011-01-26" --pretty="%h" > $TEMP1
PATCHES=$(wc -l < $TEMP1)
while read PATCH; do git log --stat $PATCH^1..$PATCH | tail -n 1; done < $TEMP1 > $TEMP2
INSERTS=`cat $TEMP2 | awk '{s+=$4} END {print s}'`
DELETES=`cat $TEMP2 | 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."
rm -f $TEMP1 $TEMP2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment