Skip to content

Instantly share code, notes, and snippets.

@syntaxritual
Created April 30, 2013 15:20
Show Gist options
  • Save syntaxritual/5489417 to your computer and use it in GitHub Desktop.
Save syntaxritual/5489417 to your computer and use it in GitHub Desktop.
usage: `harvest syntaxritual` optional: give it a starting date `harvest syntaxritual 2013-04-20`
harvest() {
dow=$(date "+%u")
if [ -n "$2" ]; then
date=$2
else
if [ $dow = "1" ]; then
date=$(date -v-mon -v -1w "+%Y-%m-%d 00:00:00")
else
date=$(date -v-mon "+%Y-%m-%d 00:00:00")
fi
fi
echo $date
git log --pretty=format:%ad\ %s\; --author="$1" --since="$date"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment