Add git-hooks install script. Update README.md

This commit is contained in:
Blake Griffith 2014-04-01 10:47:19 -05:00
parent 3f3f3c136e
commit cc5b787e53
2 changed files with 10 additions and 6 deletions

View File

@ -6,9 +6,4 @@ For now, we just have `post-checkout` and `post-merge`,
both of which just update submodules,
so make sure that you have a fully synced repo whenever you checkout or pull.
To use these hooks, you can symlink or copy them to your `.git/hooks` directory.
In `.git/hooks`, do:
ln -s ../../git-hooks/post-checkout post-checkout
ln -s ../../git-hooks/post-merge post-merge
To use these hooks, run `./install-hooks.sh`.

9
git-hooks/install-hooks.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
DOTGIT=`git rev-parse --git-dir`
TOPLEVEL=`git rev-parse --show-toplevel`
TO=${DOTGIT}/hooks
FROM=${TOPLEVEL}/git-hooks
ln -s ${FROM}/post-checkout ${TO}/post-checkout
ln -s ${FROM}/post-merge ${TO}/post-merge