Add pre-commit hook.

It is up to the user to install the hook.