Last active
February 1, 2018 07:58
-
-
Save anthonywong/824fb7ef6138c63431b08872da1b7883 to your computer and use it in GitHub Desktop.
Calculate total number of commits from merges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=0 | |
PATTERN=ti-linux-4.14.y | |
while read line; do | |
hash=`echo "$line" | cut -f1 -d' '` | |
nn=`git show "$hash" | head -2 | tail -1 | awk '{ print $2".."$3 }' | xargs git log --pretty=oneline | wc -l` | |
echo "$nn": "$line" | |
n=$(($n + $nn)) | |
done <<< "$(git log --grep 'Merge branch' --abbrev-commit --pretty=oneline | grep $PATTERN)" | |
echo "Total number of commits:" $n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment