Files
gitistics/gitistics.sh
2019-01-02 02:20:21 +01:00

37 lines
672 B
Bash
Executable File

#!/bin/bash
# Specify a directory with all Git repositories
REPODIR=~/Git
# Regex or fixed name (brackets need to be escaped with a backslash)
REPOUSER="\(structix\|Janek\)"
# Specify the start date, where the statistics should be gathered
STARTDATE='01 Jan 2018'
# --------------------
# Switch into the REPODIR
pushd $REPODIR
# Iterate over all subdirectories
for dir in $REPODIR/*/
do
dir=${dir%*/}
echo ${dir##*/}
# enter directory
cd ${dir##*/}
# show amount of commits of all users
git rev-list --count --all --author=$REPOUSER --since="01 Jan 2018"
# go back
cd ..
done
# Switch back to the original directory state
popd