Last active
February 21, 2017 19:12
-
-
Save redolivedev/b97f659c416544623854f525d70b4d93 to your computer and use it in GitHub Desktop.
Get your time from all repos in directory for the last month and save it to a file on your desktop
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
#!/bin/bash | |
# Instructions | |
## Save this file to the root of where your projects are stored | |
## cd to the projects root directory and run chmod +x _timelog.sh | |
## Change Michael Bonner to your name as it's set in your git config | |
# | |
AUTHOR="Michael Bonner" | |
ONE_MONTH_AGO=`date -j -v-1m` | |
rm -f ~/Desktop/timelog.txt | |
echo "Looking for entries for $AUTHOR" | |
for d in `find . -name .git -type d`; do | |
cd $d/.. > /dev/null | |
echo -e "\n${HIGHLIGHT}Checking `pwd`$NORMAL" | |
git log --author="$AUTHOR" --after=ONE_MONTH_AGO --date=short --pretty=format:"%ai $d : %s" >> ~/Desktop/timelog.txt | |
echo "\n" >> ~/Desktop/timelog.txt | |
cd - > /dev/null | |
done | |
sort -r -o ~/Desktop/timelog.txt ~/Desktop/timelog.txt | |
open ~/Desktop/timelog.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment