Skip to content

Instantly share code, notes, and snippets.

@joshvermaire
Created August 22, 2012 01:39
Show Gist options
  • Save joshvermaire/3421278 to your computer and use it in GitHub Desktop.
Save joshvermaire/3421278 to your computer and use it in GitHub Desktop.
Daily Cron Script for Github Logs
0 */5 * * * * /Users/joshvermaire/github/thislife/tl-html5/email.sh
#!/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