Skip to content

ranman/gitshots-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitshots — remember every commit

Testing Gitshots server with docker-compose

git clone https://github.com/ranman/gitshots
docker-compose build
docker-compose up -d
docker-compose logs

Setting up your own Gitshots server

Setting up your own Gitshots server is as easy as deploying to Heroku (just copy and paste these commands).

git clone https://github.com/ranman/gitshots
heroku create
heroku addons:add mongohq:sandbox
git push heroku master

If you don't want to set up your own Gitshots server, feel free to use ranman's (it's the default).

If you'd rather not post to Gitshots in general, just record to disk, set the GITSHOTS_SERVER_URL to False

Taking a gitshot on every commit

With your Gitshots server setup, you need to configure your computer to take gitshots.

First, add the following line to your .bash_profile or .bashrc. If you don't add this line with your server URL, your gitshots will be posted to ranman's gitshot server.

export GITSHOTS_SERVER_URL=<your gitshots server url>

Next, you'll need to make sure you have python2.7 and the requests library:

pip install requests

Next, you'll need to make sure you have imagesnap, on OSX you can easily install it with homebrew:

brew install imagesnap

Next, in any repository that you want gitshots, you need to add the following line to your .git/hooks/post-commit file (if you don't have one, create one):

/usr/bin/env python2.7 PATH_TO_GITSHOTS_REPO/post-commit.py

Next, you should install CoreLocationCLI a command line program to print location information from CoreLocation

cd /tmp
git clone git@github.com:fulldecent/corelocationcli.git
cd corelocationcli
xcodebuild
mv build/Release/CoreLocationCLI /usr/bin

USAGE: CoreLocationCLI [options]
   Displays current location using CoreLocation services.
   By default, this will continue printing locations until you kill it with Ctrl-C. 
   More info: https://github.com/fulldecent/corelocationcli

An easy way to ensure your gitshots take for every new repository you create in the future is to add the following file at /usr/share/git-core/templates/hooks/post-commit or /usr/local/share/git-core/templates/hooks/post-commit depending on your installation of git.

#!/bin/sh

# takes a gitshot on every commit
/usr/bin/env python2.7 PATH_TO_GITSHOTS_REPO/post-commit.py

Be sure to mark both of these files as executable: chmod +x post-commit

About

Making open source funnier one commit at a time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published