Skip to content

Instantly share code, notes, and snippets.

@joebuhlig
Last active October 5, 2017 18:28
Show Gist options
  • Save joebuhlig/b0c3cd227c148685f98d to your computer and use it in GitHub Desktop.
Save joebuhlig/b0c3cd227c148685f98d to your computer and use it in GitHub Desktop.
PATH=$PATH:/usr/local/bin:/usr/local/sbin
#!/bin/bash
gitbranch=`git rev-parse --abbrev-ref HEAD`
if [ $gitbranch = "master" ]; then
date=`date +%m/%d/%Y`
datetime=`date +%r`
gitwa=`git diff HEAD^ HEAD --word-diff=porcelain | grep -e "^+[^+]" | wc -w`
gitwd=`git diff HEAD^ HEAD --word-diff=porcelain | grep -e "^-[^-]" | wc -w`
commit=`git log -1 --pretty=%B`
cnt=`expr $gitwa - $gitwd`
theURL='https://script.google.com/a/macros/username/s/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/exec'
curl -L --get $theURL --data-urlencode "Date=$date" --data-urlencode "Time=$datetime" --data-urlencode "WordCount=$cnt" --data-urlencode "Commit=$commit" --data-urlencode "Adds=$gitwa" --data-urlencode "Deletes=$gitwd"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment