Support git hooks

This patch only adds pre and post commit hooks.