From 20a6183be6abe356c8e301c90536fa3252214127 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 12 Dec 2016 13:30:50 +0000 Subject: Update custom hooks docs and set 4.1.0 --- doc/administration/custom_hooks.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'doc/administration/custom_hooks.md') diff --git a/doc/administration/custom_hooks.md b/doc/administration/custom_hooks.md index 06291705702..80e5d80aa41 100644 --- a/doc/administration/custom_hooks.md +++ b/doc/administration/custom_hooks.md @@ -44,22 +44,30 @@ as appropriate. ## Chained hooks support -> [Introduced][93] in GitLab Shell 4.1.0. +> [Introduced][93] in GitLab Shell 4.1.0 and GitLab 8.15. -The hooks could be also placed in `hooks/.d` (global) or `custom_hooks/.d` (per project) -directories supporting chained execution of the hooks. +Hooks can be also placed in `hooks/.d` (global) or +`custom_hooks/.d` (per project) directories supporting chained +execution of the hooks. + +To look in a different directory for the global custom hooks (those in +`hooks/`), set `custom_hooks_dir` in gitlab-shell config. For +Omnibus installations, this can be set in `gitlab.rb`; and in source +installations, this can be set in `gitlab-shell/config.yml`. The hooks are searched and executed in this order: + 1. `.git/hooks/` - symlink to `gitlab-shell/hooks` global dir 1. `.git/hooks/` - executed by `git` itself, this is `gitlab-shell/hooks/` 1. `.git/custom_hooks/` - per project hook (this is already existing behavior) 1. `.git/custom_hooks/.d/*` - per project hooks -1. `.git/hooks/.d/*` - global hooks: all executable files (minus editor backup files) +1. `.git/hooks/.d/*` OR `//*` - global hooks: all executable files (minus editor backup files) -Files in `.d` directories need to be executable and not match the backup file pattern (`*~`). +Files in `.d` directories need to be executable and not match the backup file +pattern (`*~`). -The hooks of the same type are executed in order and execution stops on the first -script exiting with non-zero value. +The hooks of the same type are executed in order and execution stops on the +first script exiting with a non-zero value. ## Custom error messages -- cgit v1.2.1