diff options
| author | Adrian Ratiu <adrian.ratiu@collabora.com> | 2026-02-19 00:23:49 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-19 13:23:41 -0800 |
| commit | 1ecce722cdb9c42dd4c69e45e02cb850cd558ef2 (patch) | |
| tree | 8bedc56c8f312ef0f22e9c900da0a86e60c0ae03 /Documentation | |
| parent | 03b4043b9182bd3d36541371fa39f04d6d038286 (diff) | |
| download | git-1ecce722cdb9c42dd4c69e45e02cb850cd558ef2.tar.xz | |
hook: allow disabling config hooks
Hooks specified via configs are always enabled, however users
might want to disable them without removing from the config,
like locally disabling a global hook.
Add a hook.<name>.enabled config which defaults to true and
can be optionally set for each configured hook.
Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/config/hook.adoc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc index 9faafe3016..0cda4745a6 100644 --- a/Documentation/config/hook.adoc +++ b/Documentation/config/hook.adoc @@ -13,3 +13,10 @@ hook.<name>.event:: specified event, the associated `hook.<name>.command` is executed. This is a multi-valued key. To run `hook.<name>` on multiple events, specify the key more than once. See linkgit:git-hook[1]. + +hook.<name>.enabled:: + Whether the hook `hook.<name>` is enabled. Defaults to `true`. + Set to `false` to disable the hook without removing its + configuration. This is particularly useful when a hook is defined + in a system or global config file and needs to be disabled for a + specific repository. See linkgit:git-hook[1]. |
