1
2
3
4
5
6
7
8
9
10
11
12
13
| 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
|