option hooks.global.
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
git-hooks provide a way to manage and share your hooks by allowing for the installation of hooks in three locations:
- User hooks that are installed in ~/.git_hooks/
- Project hooks that are installed in the git_hooks directory inside of each project.
- - Global hooks that are specified with the environment variable GLOBAL_GIT_HOOKS.
-
-When GLOBAL_GIT_HOOKS is not set it defaults to the git-hooks /contrib/ folder.
+ - Global hooks that are specified with the hooks.global configuration option.
+
Multiple global hooks directories can be specified by using a space between each path.
For more details on Git Hooks checkout the online documentation at http://www.kernel.org/pub/software/scm/git/docs/githooks.html
hook="${1}"
echo "${HOME}/.git_hooks/${hook}"
echo "${PWD}/git_hooks/${hook}"
- if [ -z ${GLOBAL_GIT_HOOKS} ] ; then
- echo "${GHD}/contrib/${hook}"
- else
- echo "${GLOBAL_GIT_HOOKS}"
- fi
+ echo "`git config hooks.global`"/${hook}
}
function list_hooks_in_dir