Created
August 11, 2017 21:28
-
-
Save dleve123/a1f1dffb7e0677ff2710f39d40883470 to your computer and use it in GitHub Desktop.
Commit Counts
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
# USAGE: run from directory that contains Git directories to iterate over | |
summary() { | |
for directory in $( ls -d */ ); do | |
cd $directory | |
if [ -d ".git" ]; then | |
git pull > /dev/null 2>&1 | |
echo $directory,`commit_count` | |
fi | |
cd .. | |
done | |
} | |
commit_count() { | |
git log --since="2 weeks ago" | | |
grep "Author: " | | |
wc -l | | |
sed -e 's/^[ \t]*//' | |
} | |
total_count() { | |
count=$(summary | cut -d , -f 2 | paste -sd+ - | bc) | |
echo "total commit count: $count" | |
} | |
summary | |
total_count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment