Last active
June 29, 2017 12:33
-
-
Save Benjamin-Dobell/bb7ae216036c7e5641b3731fafa2598c to your computer and use it in GitHub Desktop.
End of financial year logs
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
LOG_DIR=~/EOFY/2016-2017/ | |
mkdir -p $LOG_DIR | |
for dir in */ ; do | |
cd $dir | |
if git log &> /dev/null; then | |
project=$(basename $dir) | |
for branch in $(git for-each-ref --format='%(refname:strip=2)' refs/heads/); do | |
LOG=$(git log $(git merge-base master $branch)..$branch --since="2016-07-01T00:00:00+10:00") | |
if [ -n "$LOG" ]; then | |
echo $LOG > $LOG_DIR/$project.$branch.log | |
fi | |
done | |
LOG=$(git log master --since "2016-00-01T00:00:00+10:00") | |
if [ -n "$LOG" ]; then | |
echo $LOG > $LOG_DIR/$project.master.log | |
fi | |
fi | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment