Skip to content

Instantly share code, notes, and snippets.

@Stephanvs
Created July 20, 2015 11:57
Show Gist options
  • Save Stephanvs/34b72c060b113471945d to your computer and use it in GitHub Desktop.
Save Stephanvs/34b72c060b113471945d to your computer and use it in GitHub Desktop.
#!/bin/bash
# VERSION=1
git status 2&> /dev/null
if [ "$?" != "0" ]; then
# echo "repo found"
# else
echo "Git repository not found in current directory" 1>&2
exit 1
fi
# 1. retrieve git log
# 2. compress it
# 3. pipe to remote server for analys
git log \
--format="%n%n%an <%ae>%n%n%ci" \
--numstat \
--since=2014-01-01 \
--no-merges \
--date-order | \
gzip | \
curl -s -X PUT \
-H 'Content-type: application/octet-stream' \
-H "Content-Encoding: gzip" \
--data-binary @- \
--compressed "http://gitminer.com/parser/do?version=$VERSION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment