Safe Commit Hook
It adds an automatic check to prevent developers from checking in suspicious files (as defined by Gitrob's signatures.json)
git clone https://github.com/jandre/safe-commit-hook.git cd safe-commit-hook make install
This will do the following:
- Create a
~/.safe-commit-hookdirectory and copy the files from this repo there.
- Create a git alias so you can do
git init-safe-commitin a project directory, which will create
.git/hooks/pre-commit(WARNING: will blow away any other pre-commit hooks).
Now you will get an error if you try to do anything fishy!
Editing the rules
They are currently in JSON format at
Just remove the rules you wish to ignore. In the future, would nice to have a
.git-safe-commit-ignore file for a repo.
- Allow project specific exceptions for safe commit checks.
- Don't blow away any other git pre-commit hooks in
- Extend the JSON spec to allow for searching for body of modified files.