Commit Graph

9 Commits

Author SHA1 Message Date
Robert Maynard
a36399ccfa Use generalized developer GitSetup hooks
Add hooks branch for VTK-m so that developers can get some pre-commit checks
easily.

Commands used to setup GitSetup:
  git remote add -f setup https://robertmaynard@gitlab.kitware.com/utils/gitsetup.git
  git merge --no-commit --allow-unrelated-histories setup/hooks
  git read-tree -u --prefix=. setup/hooks
2017-05-26 14:47:25 -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
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
b966ceb437 prepare-commit-msg: Add Gerrit Change-Id to merges
The "git merge" command generates its own commit message and does not
invoke the commit-msg hook.  Fortunately it invokes prepare-commit-msg
so teach it to call the gerrit/commit-msg hook for merges.

Suggested-by: Chris Harris <chris.harris@kitware.com>
2012-02-06 14:39:18 -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
Brad King
5d41660836 Update copyright notices for year 2011 2011-01-13 15:33:33 -05:00
Brad King
dc31be5bda Chain to script configured by "hooks.chain-<hook>"
Chain the pre-commit, commit-msg, and prepare-commit-msg hooks to
locally configured scripts.  Interpret relative paths with respect to
the working directory where the hooks run (top of work tree).  This
allows project setup scripts to add project-specific checks for each of
these hooks.
2010-11-16 17:40:16 -05:00