Created
September 15, 2017 12:30
-
-
Save michal-lipski/c5b33f7d5db81fd87a8a0f9a6b1a80f8 to your computer and use it in GitHub Desktop.
Number of days in git project per user.
This file contains 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
# number of days beetween first and last commit by user | |
mapfile -t authors < <( git log --pretty=format:%an | sort | uniq ) | |
echo "Number of authors:" ${#authors[@]} | |
for author in "${authors[@]}" | |
do | |
lastCommitDate=`git log --pretty=format:%at --author="$author" | sed -n 1p` | |
firstCommitDate=`git log --pretty=format:%at --author="$author" | tail -1` | |
if [ ! -z "$lastCommitDate" ]; | |
then | |
daysInProject=$((($lastCommitDate - $firstCommitDate)/60/60/24)) | |
echo $author" "$daysInProject | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment