GitHook Cook is my attempt to make implementing workflows with Git Hooks simpler for PHP developers. This code approaches git hooks with a Drupal sensibility of implementing hooks rather than creating files.
This project might be dropped (or simply take inspiration from) [https://github.com/icefox/git-hooks git-hooks], which I found after beginning work here.
Installation is currently super primitive.
-
Place the cook directory inside the .git/hooks directory of your repository.
-
Create symlinks from existing git hooks to githook_cook.php. For example:
$> ln -s cook/githook_cook.php pre-commit
githook_cook.php can be run standalone.
$> ./githook_cook.php test <git-event>
Can be used to run the routines of, say, pre-commit against a directory of mostly empty test files.
This test mode replaces the git.inc library with a test.git.inc library with faked functionality.
- Have Drupal Coder validation.
- Implement some kind of configuration of Cook Plugins. Possibly using Git configuration. Definitely needs to support system defaults and local overrides.
- Provide some wrapper functions for other common git workflow tasks, such as sending emails, getting other common git data.