Commit Graph

8 Commits

Author SHA1 Message Date
Brad King
6f2466c503 Add a 'pre-push' hook
For now do nothing but chain to a project-specific hook.
2014-09-10 16:31:32 -04:00
Brad King
0d9698a151 Load project-specific "start" hooks before our checks
Read from the project ".hooks-config" a configuration value

 hooks.start.commit-msg
 hooks.start.pre-commit
 hooks.start.prepare-commit-msg

to run from our respective hook before its main checks.
2013-04-04 13:48:59 -04:00
Brad King
c530aa9375 hooks-config: Factor child execution out of hooks_chain
Factor child execution into a separate "hooks_child" function so it can
be re-used.
2013-04-04 13:45:52 -04:00
Brad King
e684969995 hooks-config: Read 'git config' values from project .hooks-config
Allow projects to configure hooks with a 'git config'-formatted file at
the top of their source tree called ".hooks-config".  This avoids use of
bash-specific syntax and makes configuration declarative.
2013-04-04 13:32:52 -04:00
Brad King
2d9ee2a97c hooks-config: Subsume hooks-chain functionality
Remove hooks-chain.bash and place its content in hooks-config.bash.
2013-04-04 13:26:20 -04:00
Chuck Atkins
646b891d70 Make all hook references relative to thier location
Some hooks were getting referenced directly via $GIT_DIR/hooks while at
other times getting referenced relative via ${BASH_SOURCE%/*}.  By making
all references relative then these hooks can reside in a different folder
and still be daisy-chained by other hooks.
2012-10-10 13:12:18 -04:00
Brad King
5ebbe2dacc Set GIT_DIR if not already set
Although it seems reasonable to expect GIT_DIR to be set when
hooks are invoked, the "git help hooks" documentation does not
guarantee it.  On msysGit 1.7.8 (and perhaps others) "git gui"
runs prepare-commit-msg without setting GIT_DIR.  Set GIT_DIR
at the beginning of each commit hook if it is not already set.
2012-02-29 16:32:01 -05:00
Brad King
18358af310 Load local hooks configuration from work tree
Look for a ".hooks-config.bash" file at the top of the work tree.
Load it in each hook to get per-project configuration.  Currently
we do not define any config options, but this adds the framework.
2011-10-06 17:56:05 -04:00