Git's hook system is very useful for automating workflow-related tasks.
It would be even better if you could register multiple programs for a hook to run.
Since such a feature is trivial to implement, it is a wheel that has been crafted many times over.
This is my re-invention.
- Do not actively ambush Windows (i.e. don't require symlinks, because they're second-class citizens on Windows)
- Allow sharing hook packages between different repositories
- Fit my personal aesthetic
Hook packages let you share git hooks between multiple projects. Why do that?
- A company's repositories could share a commit message checker, to ensure every commit has a ticket ID in it.
- A team's style guide could be written as pre-commit and pre-receive hooks, then used to enforce adherence across their projects.
- Dependency managers like npm and pip are used by a lot of different projects. All those projects could share a generic set of git hooks for updating installed dependencies after pulls, checkouts, and rebases.
Install Bats, then:
cd tests
bats suite.bats