From 1ecce722cdb9c42dd4c69e45e02cb850cd558ef2 Mon Sep 17 00:00:00 2001 From: Adrian Ratiu Date: Thu, 19 Feb 2026 00:23:49 +0200 Subject: 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..enabled config which defaults to true and can be optionally set for each configured hook. Suggested-by: Patrick Steinhardt Signed-off-by: Adrian Ratiu Signed-off-by: Junio C Hamano --- Documentation/config/hook.adoc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation') 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..event:: specified event, the associated `hook..command` is executed. This is a multi-valued key. To run `hook.` on multiple events, specify the key more than once. See linkgit:git-hook[1]. + +hook..enabled:: + Whether the hook `hook.` 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]. -- cgit v1.3