Created
August 22, 2012 01:39
-
-
Save joshvermaire/3421278 to your computer and use it in GitHub Desktop.
Daily Cron Script for Github 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
0 */5 * * * * /Users/joshvermaire/github/thislife/tl-html5/email.sh |
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
#!/bin/bash | |
# duration of log (default: daily) as offset since now | |
RELDATE="10 hours ago" | |
GITROOT=/Users/joshvermaire/github/thislife/tl-html5 | |
# branch | |
BRANCH=refs/heads/master | |
# the latest commit | |
NEWREV=`git rev-list -n 1 HEAD` | |
# the latest commit not to report | |
OLDREV=`git rev-list -n 1 --date=relative --until="$RELDATE" HEAD` | |
# only send an email if there are commits | |
if [[ $NEWREV == $OLDREV ]] | |
then | |
exit 0 | |
fi | |
OUTPUT=`git log -M --pretty=format:"Author: %aN (%ae)%nTime: %ar%nTitle: %s" --shortstat --no-merges --since="$RELDATE"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment