use the $GIT_DIR variable wherever we can

This way, hooks should work from everywhere in the repo
fixes #11

Rebasing must stay fast, so let's detect it and disable hooks.