Jig is a Git pre-commit hook on steroids.
Git Hooks are little scripts that you can place in your $GIT_DIR/hooks directory to trigger actions at certain points. The pre-commit hook is useful for performing actions right before Git writes a commit.
Jig is a command line tool as well as a utility for creating and running “plugins”.
It has a set of common plugins that will probably be useful to you right now, but the real goal is to make it easy for you to write your own.
The Jig command line tool is written in Python and is available on PyPi.
$ pip install jig || easy_install jig
This is just a little shell trick that uses easy_install if it can’t locate pip.
Jig currently supports Python 2.6 and Python 2.7.
Change directories into your Git repository and initialize it to use Jig.
$ cd myrepo
$ jig init .
Git repository has been initialized for use with Jig.
You should tell Git to ignore the new .jig directory. Run this:
$ echo ".jig" >> .gitignore
Next install some plugins. Jig has a common set you may like:
$ curl -L https://raw.github.com/robmadole/jig-plugins/lists/common.txt > .jigplugins.txt
$ jig install .jigplugins.txt
Create a file that lists the plugins you’d like to install.
$ curl -L https://raw.github.com/robmadole/jig-plugins/lists/common.txt > .jigplugins.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 97 100 97 0 0 144 0 --:--:-- --:--:-- --:--:-- 425
Install the Jig plugins.
$ jig install .jigplugins.txt
From http://github.com/robmadole/jig-plugins@whitespace:
- Added plugin whitespace in bundle jig-plugins
From http://github.com/robmadole/jig-plugins@woops:
- Added plugin woops in bundle jig-plugins
Run the plugins in the current repository with this command:
$ jig runnow
Jig works off of your staged files in the Git repository index.
You place things in the index with `git add`. You will need to stage
some files before you can run Jig.
Stage some changes and then commit.
$ git add mylib.py
Jig will run and let you know if it catches anything.
$ git commit -m 'Adding my awesome new library'
▾ woops
⚠ line 23: mylib.py
print statement
Ran 1 plugin
Info 0 Warn 1 Stop 0
Commit anyway (hit enter), or "c" to cancel the commit
Release 0.1.11 - February 28th, 2015
Release 0.1.10 - July 23rd, 2014
Release 0.1.9 - February 22nd, 2014
Release 0.1.8 - February 1st, 2014
Release 0.1.7 - December 13th, 2013
Release 0.1.6 - April 28th, 2013
Release 0.1.5 - April 10th, 2013
Release 0.1.4 - March 24th, 2013
Release 0.1.3 - February 16th, 2013
Release 0.1.2 - February 13th, 2013
Release 0.1.1 - February 7th, 2013
Release 0.1.0 - April 6th, 2012
Jig is licensed under a BSD license.