{"thread":{"id":"66606","subject":"[PATCH 0/2] Fix two hook configuration bugs","startedAt":"2026-10-20T18:19:11Z","lastAt":"2026-10-23T17:53:51Z","messageCount":11,"participants":["Thomas Bachem via GitGitGadget","Junio C Hamano","Adrian Ratiu"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"555589","messageId":"pull.2272.git.1792520353.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":null,"subject":"[PATCH 0/2] Fix two hook configuration bugs","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-20T18:19:11Z","receivedAt":"2026-10-20T18:19:11Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"Two small fixes for hook configuration. With the first,\nhook.pre-commit.enabled=false also stops the pre-commit hook in the hooks\ndirectory, as the documentation says. With the second, hook.*.enabled and\nhook.*.parallel can be given without a value, which means true, as for any\nother boolean.\n\nThomas Bachem (2):\n  hook: honor hook.<event>.enabled for the hookdir hook\n  hook: accept .enabled and .parallel given without a value\n\n builtin/hook.c  |  6 ++++--\n hook.c          | 17 +++++++++++------\n hook.h          |  8 +++++++-\n t/t1800-hook.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++--\n 4 files changed, 71 insertions(+), 11 deletions(-)\n\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2272%2Fthomasbachem%2Fhook-event-enabled-hookdir-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2272/thomasbachem/hook-event-enabled-hookdir-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2272\n-- \ngitgitgadget\n\n"},{"id":"555590","messageId":"1a7d060fae0decbe7dda63ec4ab57e32e0205df0.1792520353.git.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":"pull.2272.git.1792520353.gitgitgadget@gmail.com","subject":"[PATCH 1/2] hook: honor hook.<event>.enabled for the hookdir hook","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-20T18:19:12Z","receivedAt":"2026-10-20T18:19:12Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"From: Thomas Bachem <mail@thomasbachem.com>\n\nThe documentation added by dcfb5af67e (hook: add hook.<event>.enabled\nswitch, 2026-04-10) says that with hook.<event>.enabled set to false\n\"no hooks fire for that event\", but only hooks defined in the\nconfiguration are skipped. With hook.pre-commit.enabled=false,\n\"git commit\" still runs .git/hooks/pre-commit, and \"git hook list\"\nshows that hook without the \"event-disabled\" mark.\n\nMove the event_disabled flag out of u.configured in struct hook, set\nit for the hookdir hook too, and check it for both kinds of hooks.\n\nThe test for hook.<event>.enabled=false looks only at the standard\noutput, but \"git hook run\" sends hook output to the standard error,\nso the test passes even when a disabled hook runs. Add a hookdir hook\nto it and check the standard error as well.\n\nAssisted-by: Claude Fable 5.1\nSigned-off-by: Thomas Bachem <mail@thomasbachem.com>\n---\n builtin/hook.c  |  6 ++++--\n hook.c          | 14 +++++++++-----\n hook.h          |  8 +++++++-\n t/t1800-hook.sh | 29 +++++++++++++++++++++++++++--\n 4 files changed, 47 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/hook.c b/builtin/hook.c\nindex cceeb3586e..1ea698ecc2 100644\n--- a/builtin/hook.c\n+++ b/builtin/hook.c\n@@ -82,7 +82,9 @@ static int list(int argc, const char **argv, const char *prefix,\n \n \t\tswitch (h->kind) {\n \t\tcase HOOK_TRADITIONAL:\n-\t\t\tprintf(\"%s%c\", _(\"hook from hookdir\"), line_terminator);\n+\t\t\tprintf(\"%s%s%c\",\n+\t\t\t       h->event_disabled ? \"event-disabled\\t\" : \"\",\n+\t\t\t       _(\"hook from hookdir\"), line_terminator);\n \t\t\tbreak;\n \t\tcase HOOK_CONFIGURED: {\n \t\t\tconst char *name = h->u.configured.friendly_name;\n@@ -95,7 +97,7 @@ static int list(int argc, const char **argv, const char *prefix,\n \t\t\t * \"disabled\" surfaces once the event is re-enabled.\n \t\t\t */\n \t\t\tconst char *disability =\n-\t\t\t\th->u.configured.event_disabled ? \"event-disabled\\t\" :\n+\t\t\t\th->event_disabled              ? \"event-disabled\\t\" :\n \t\t\t\th->u.configured.disabled       ? \"disabled\\t\"       :\n \t\t\t\t\t\t\t\t \"\";\n \t\t\tif (scope)\ndiff --git a/hook.c b/hook.c\nindex d10eef4763..5e756cb353 100644\n--- a/hook.c\n+++ b/hook.c\n@@ -115,6 +115,9 @@ static void list_hooks_add_default(struct repository *r, const char *hookname,\n \n \th->kind = HOOK_TRADITIONAL;\n \th->u.traditional.path = xstrdup(hook_path);\n+\t/* list_hooks_add_configured() has loaded r->disabled_events */\n+\th->event_disabled = !!unsorted_string_list_lookup(&r->disabled_events,\n+\t\t\t\t\t\t\t  hookname);\n \n \tstring_list_append(hook_list, hook_path)->util = h;\n }\n@@ -514,7 +517,7 @@ static void list_hooks_add_configured(struct repository *r,\n \t\t\tentry->command ? xstrdup(entry->command) : NULL;\n \t\thook->u.configured.scope = entry->scope;\n \t\thook->u.configured.disabled = entry->disabled;\n-\t\thook->u.configured.event_disabled = event_is_disabled;\n+\t\thook->event_disabled = event_is_disabled;\n \t\thook->parallel = entry->parallel;\n \n \t\tstring_list_append(list, friendly_name)->util = hook;\n@@ -559,8 +562,9 @@ int hook_exists(struct repository *r, const char *name)\n \n \tfor (size_t i = 0; i < hooks->nr; i++) {\n \t\tstruct hook *h = hooks->items[i].util;\n-\t\tif (h->kind == HOOK_TRADITIONAL ||\n-\t\t    (!h->u.configured.disabled && !h->u.configured.event_disabled)) {\n+\t\tif (!h->event_disabled &&\n+\t\t    (h->kind == HOOK_TRADITIONAL ||\n+\t\t     !h->u.configured.disabled)) {\n \t\t\texists = 1;\n \t\t\tbreak;\n \t\t}\n@@ -583,8 +587,8 @@ static int pick_next_hook(struct child_process *cp,\n \t\tif (hook_cb->hook_to_run_index >= hook_list->nr)\n \t\t\treturn 0;\n \t\th = hook_list->items[hook_cb->hook_to_run_index++].util;\n-\t} while (h->kind == HOOK_CONFIGURED &&\n-\t\t (h->u.configured.disabled || h->u.configured.event_disabled));\n+\t} while (h->event_disabled ||\n+\t\t (h->kind == HOOK_CONFIGURED && h->u.configured.disabled));\n \n \tcp->no_stdin = 1;\n \tstrvec_pushv(&cp->env, hook_cb->options->env.v);\ndiff --git a/hook.h b/hook.h\nindex 27bb1aeb2e..6af24cb331 100644\n--- a/hook.h\n+++ b/hook.h\n@@ -32,10 +32,16 @@ struct hook {\n \t\t\tconst char *command;\n \t\t\tenum config_scope scope;\n \t\t\tbool disabled;\n-\t\t\tbool event_disabled;\n \t\t} configured;\n \t} u;\n \n+\t/**\n+\t * Whether this hook's event is disabled with\n+\t * `hook.<event>.enabled = false`. This applies to configured hooks\n+\t * and the hookdir hook alike.\n+\t */\n+\tbool event_disabled;\n+\n \t/**\n \t * Whether this hook may run in parallel with other hooks for the same\n \t * event. Only useful for configured (named) hooks. Traditional hooks\ndiff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\nindex 7d4b2982b4..27cb0eb01c 100755\n--- a/t/t1800-hook.sh\n+++ b/t/t1800-hook.sh\n@@ -496,6 +496,15 @@ test_expect_success 'disabled configured hook is not reported as existing by hoo\n \ttest_grep ! \"pre-commit\" git-bugreport-hook-exists-test.txt\n '\n \n+test_expect_success 'event-disabled hookdir hook is not reported as existing by hook_exists' '\n+\ttest_when_finished \"rm -f git-bugreport-hook-exists-test.txt\" &&\n+\tsetup_hookdir &&\n+\ttest_config hook.pre-commit.enabled false &&\n+\n+\tgit bugreport -s hook-exists-test &&\n+\ttest_grep ! \"pre-commit\" git-bugreport-hook-exists-test.txt\n+'\n+\n test_expect_success 'globally disabled hook can be re-enabled locally' '\n \ttest_config_global hook.global-hook.event \"test-hook\" &&\n \ttest_config_global hook.global-hook.command \"echo \\\"global-hook ran\\\"\" &&\n@@ -1110,9 +1119,13 @@ test_expect_success 'hook.<event>.jobs rejects values less than -1' '\n test_expect_success 'hook.<event>.enabled=false skips all hooks for event' '\n \ttest_config hook.hook-1.event test-hook &&\n \ttest_config hook.hook-1.command \"echo ran\" &&\n+\ttest_hook test-hook <<-\\EOF &&\n+\techo ran\n+\tEOF\n \ttest_config hook.test-hook.enabled false &&\n \tgit hook run --allow-unknown-hook-name test-hook >out 2>err &&\n-\ttest_must_be_empty out\n+\ttest_must_be_empty out &&\n+\ttest_must_be_empty err\n '\n \n test_expect_success 'hook.<event>.enabled=true does not suppress hooks' '\n@@ -1147,10 +1160,14 @@ test_expect_success 'git hook list shows event-disabled hooks as event-disabled'\n \ttest_config hook.hook-1.command \"echo ran\" &&\n \ttest_config hook.hook-2.event test-hook &&\n \ttest_config hook.hook-2.command \"echo ran\" &&\n+\ttest_hook test-hook <<-\\EOF &&\n+\techo ran\n+\tEOF\n \ttest_config hook.test-hook.enabled false &&\n \tgit hook list --allow-unknown-hook-name test-hook >actual &&\n \ttest_grep \"^event-disabled\thook-1$\" actual &&\n-\ttest_grep \"^event-disabled\thook-2$\" actual\n+\ttest_grep \"^event-disabled\thook-2$\" actual &&\n+\ttest_grep \"^event-disabled\thook from hookdir$\" actual\n '\n \n test_expect_success 'git hook list shows scope with event-disabled' '\n@@ -1169,6 +1186,14 @@ test_expect_success 'git hook list still shows hooks when event is disabled' '\n \ttest_grep \"event-disabled\" actual\n '\n \n+test_expect_success 'commit skips the hookdir hook with hook.pre-commit.enabled=false' '\n+\ttest_hook pre-commit <<-\\EOF &&\n+\texit 1\n+\tEOF\n+\ttest_must_fail git commit --allow-empty -m blocked &&\n+\tgit -c hook.pre-commit.enabled=false commit --allow-empty -m allowed\n+'\n+\n test_expect_success 'friendly-name matching known event name is rejected' '\n \ttest_config hook.pre-commit.event pre-commit &&\n \ttest_config hook.pre-commit.command \"echo oops\" &&\n-- \ngitgitgadget\n\n\n"},{"id":"555591","messageId":"3db167c9d1449916d84f82151d68de9460512c3d.1792520353.git.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":"pull.2272.git.1792520353.gitgitgadget@gmail.com","subject":"[PATCH 2/2] hook: accept .enabled and .parallel given without a value","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-20T18:19:13Z","receivedAt":"2026-10-20T18:19:13Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"From: Thomas Bachem <mail@thomasbachem.com>\n\nhook.<name>.enabled and hook.<name>.parallel are booleans, and\ngit-config(1) documents a boolean without a value as true. But\nhook_config_lookup_all() rejects every hook.<name>.<key> that has no\nvalue, so \"git -c hook.lint.parallel hook run pre-commit\" fails with\n\"missing value for 'hook.lint.parallel'\", and so does a bare\n\"parallel\" under [hook \"lint\"]. The same happens with .enabled, for a\nhook as well as for an event.\n\nKeep rejecting a missing value for the other keys. For .enabled and\n.parallel, pass it to git_parse_maybe_bool(), which takes it as true.\n\nAssisted-by: Claude Fable 5.1\nSigned-off-by: Thomas Bachem <mail@thomasbachem.com>\n---\n hook.c          |  3 ++-\n t/t1800-hook.sh | 22 ++++++++++++++++++++++\n 2 files changed, 24 insertions(+), 1 deletion(-)\n\ndiff --git a/hook.c b/hook.c\nindex 5e756cb353..c500fec33e 100644\n--- a/hook.c\n+++ b/hook.c\n@@ -184,7 +184,8 @@ static int hook_config_lookup_all(const char *key, const char *value,\n \t\treturn 0;\n \t}\n \n-\tif (!value)\n+\t/* .enabled and .parallel are bools, where a missing value means true */\n+\tif (!value && strcmp(subkey, \"enabled\") && strcmp(subkey, \"parallel\"))\n \t\treturn config_error_nonbool(key);\n \n \t/* Extract name, ensuring it is null-terminated. */\ndiff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\nindex 27cb0eb01c..223c399ef0 100755\n--- a/t/t1800-hook.sh\n+++ b/t/t1800-hook.sh\n@@ -516,6 +516,17 @@ test_expect_success 'globally disabled hook can be re-enabled locally' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'hook.<friendly-name>.enabled without a value means true' '\n+\ttest_config_global hook.global-hook.event \"test-hook\" &&\n+\ttest_config_global hook.global-hook.command \"echo \\\"global-hook ran\\\"\" &&\n+\ttest_config_global hook.global-hook.enabled false &&\n+\n+\techo \"global-hook ran\" >expected &&\n+\tgit -c hook.global-hook.enabled \\\n+\t\thook run --allow-unknown-hook-name test-hook 2>actual &&\n+\ttest_cmp expected actual\n+'\n+\n test_expect_success 'configured hooks run before hookdir hook' '\n \tsetup_hookdir &&\n \ttest_config hook.first.event \"pre-commit\" &&\n@@ -1080,6 +1091,17 @@ test_expect_success 'hook.jobs=-1 resolves to online_cpus()' '\n \ttest_grep \"\\\"region_enter\\\".*\\\"hook\\\".*\\\"test-hook\\\".*\\\"max:$cpus\\\"\" trace.txt\n '\n \n+test_expect_success 'hook.<friendly-name>.parallel without a value means true' '\n+\ttest_config hook.hook-1.event test-hook &&\n+\ttest_config hook.hook-1.command \"true\" &&\n+\ttest_config hook.jobs 2 &&\n+\n+\tGIT_TRACE2_EVENT=\"$(pwd)/trace-parallel.txt\" \\\n+\t\tgit -c hook.hook-1.parallel \\\n+\t\thook run --allow-unknown-hook-name test-hook >out 2>err &&\n+\ttest_grep \"\\\"region_enter\\\".*\\\"hook\\\".*\\\"test-hook\\\".*\\\"max:2\\\"\" trace-parallel.txt\n+'\n+\n test_expect_success 'hook.<event>.jobs=-1 resolves to online_cpus()' '\n \ttest_config hook.hook-1.event test-hook &&\n \ttest_config hook.hook-1.command \"true\" &&\n-- \ngitgitgadget\n\n"},{"id":"555603","messageId":"xmqqzew8us4s.fsf@gitster.g","threadId":"66606","inReplyTo":"1a7d060fae0decbe7dda63ec4ab57e32e0205df0.1792520353.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/2] hook: honor hook.<event>.enabled for the hookdir hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-20T18:46:43Z","receivedAt":"2026-10-20T18:46:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Thomas Bachem via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Thomas Bachem <mail@thomasbachem.com>\n>\n> The documentation added by dcfb5af67e (hook: add hook.<event>.enabled\n> switch, 2026-04-10) says that with hook.<event>.enabled set to false\n> \"no hooks fire for that event\", but only hooks defined in the\n> configuration are skipped.\n\nIt is good to see that the original author and those who helped\nwere CC'ed.\n\nI have a suspicion that the current behavior may be very much\ndeliberate, and the documentation was written too loosely.  In\nother words, the author may have been so excited about their shiny\nnew toy, the configuration-defined hook mechanism, that they wrote\nas if that were the only kind of hook that existed in the world,\neven though that is not true.\n\nLet's see what others want to happen.\n\nThanks.\n\n"},{"id":"555624","messageId":"877bjc2im5.fsf@collabora.com","threadId":"66606","inReplyTo":"xmqqzew8us4s.fsf@gitster.g","subject":"Re: [PATCH 1/2] hook: honor hook.<event>.enabled for the hookdir hook","fromName":"Adrian Ratiu","fromEmail":"adrian.ratiu@collabora.com","sentAt":"2026-10-20T20:59:46Z","receivedAt":"2026-10-20T20:59:46Z","isPatch":true,"sender":{"key":"adrian.ratiu@collabora.com","avatar":"https://avatars.githubusercontent.com/u/12472556?v=4"},"body":"\nOn October 20, 2026 6:46:43 PM UTC, Junio C Hamano <gitster@pobox.com> wrote:\n>\"Thomas Bachem via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> From: Thomas Bachem <mail@thomasbachem.com>\n>>\n>> The documentation added by dcfb5af67e (hook: add hook.<event>.enabled\n>> switch, 2026-04-10) says that with hook.<event>.enabled set to false\n>> \"no hooks fire for that event\", but only hooks defined in the\n>> configuration are skipped.\n>\n>It is good to see that the original author and those who helped\n>were CC'ed.\n>\n>I have a suspicion that the current behavior may be very much\n>deliberate, and the documentation was written too loosely.  In\n>other words, the author may have been so excited about their shiny\n>new toy, the configuration-defined hook mechanism, that they wrote\n>as if that were the only kind of hook that existed in the world,\n>even though that is not true.\n\nThe suspicion is correct: I did not intend to disable the hookdir hooks\nvia configs when I wrote that initially.\n\nMy reasoning was something like \"configs affect just the config-defined\nhooks, the traditional hookdir hooks behave the same as before\". \n\nSo currently the doc is indeed just too loose.\n\nHowever, having said that, I don't have a strong opinion and am ok\neither way, so if others think it's a good idea, we could accept this\npatch instead of fixing the doc. :)\n\n"},{"id":"555765","messageId":"xmqqbj8nosq1.fsf@gitster.g","threadId":"66606","inReplyTo":"877bjc2im5.fsf@collabora.com","subject":"Re: [PATCH 1/2] hook: honor hook.<event>.enabled for the hookdir hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-21T17:42:46Z","receivedAt":"2026-10-21T17:42:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adrian Ratiu <adrian.ratiu@collabora.com> writes:\n\n> The suspicion is correct: I did not intend to disable the hookdir hooks\n> via configs when I wrote that initially.\n>\n> My reasoning was something like \"configs affect just the config-defined\n> hooks, the traditional hookdir hooks behave the same as before\". \n>\n> So currently the doc is indeed just too loose.\n\nThanks for confirming my suspicion.  After re-reading the document,\nI am not sure if it was overly loose (see below).\n\n> However, having said that, I don't have a strong opinion and am ok\n> either way, so if others think it's a good idea, we could accept this\n> patch instead of fixing the doc. :)\n\nI am undecided if we should treat it as a backward incompatible\nchange or if we should just label this change as a \"bugfix\".\n\nThe additional documentation in question said\n\n    hook.<event>.enabled::\n       Switch to enable or disable all hooks for the `<event>` hook event.\n       When set to `false`, no hooks fire for that event, regardless of any\n       per-hook `hook.<friendly-name>.enabled` settings. Defaults to `true`.\n       See linkgit:git-hook[1].\n\nwhich talks about \"hook.<friendly-name>.enabled\" setting, hinting\nthat this is also about the hooks that can be controlled by that\nother setting, which was added by 1ecce722cd (hook: allow disabling\nconfig hooks, 2026-02-19), which added \"diable\" specifically for\n\"config hooks\", and the documentation from that addition says:\n\n    hook.<friendly-name>.enabled::\n\tWhether the hook `hook.<name>` is enabled. Defaults to `true`.\n\tSet to `false` to disable the hook without removing its\n\tconfiguration. This is particularly useful when a hook is defined\n\tin a system or global config file and needs to be disabled for a\n\tspecific repository. See linkgit:git-hook[1].\n\nmentioning \"removing its configuration\", and \"defined in ... config\nfile\", to me, it is very clear that this configuration variable is\nonly about the hooks defined in the configuration system.\n\nWhich tempts me to say that the change being discussed is a backward\nincompatible breakage, rather than a bugfix.\n\nBut casual end-users would of course do not know how the feature\nevolved, and may not read the documentation of the feature they use\ncarefully enough.  So I dunno.  Perhaps changing the behaviour at\nthe same time updating the documentation to make it clear these\ncover all kinds of hooks, not just the configuration-defined ones,\nmay be sufficient.\n\nThanks.\n\n\n"},{"id":"555866","messageId":"874ied3las.fsf@collabora.com","threadId":"66606","inReplyTo":"xmqqbj8nosq1.fsf@gitster.g","subject":"Re: [PATCH 1/2] hook: honor hook.<event>.enabled for the hookdir hook","fromName":"Adrian Ratiu","fromEmail":"adrian.ratiu@collabora.com","sentAt":"2026-10-22T13:40:59Z","receivedAt":"2026-10-22T13:40:59Z","isPatch":true,"sender":{"key":"adrian.ratiu@collabora.com","avatar":"https://avatars.githubusercontent.com/u/12472556?v=4"},"body":"On Wed, 21 Oct 2026, Junio C Hamano <gitster@pobox.com> wrote:\n> Adrian Ratiu <adrian.ratiu@collabora.com> writes:\n>> However, having said that, I don't have a strong opinion and am ok\n>> either way, so if others think it's a good idea, we could accept this\n>> patch instead of fixing the doc. :)\n>\n> I am undecided if we should treat it as a backward incompatible\n> change or if we should just label this change as a \"bugfix\".\n>\n> The additional documentation in question said\n>\n>     hook.<event>.enabled::\n>        Switch to enable or disable all hooks for the `<event>` hook event.\n>        When set to `false`, no hooks fire for that event, regardless of any\n>        per-hook `hook.<friendly-name>.enabled` settings. Defaults to `true`.\n>        See linkgit:git-hook[1].\n>\n> which talks about \"hook.<friendly-name>.enabled\" setting, hinting\n> that this is also about the hooks that can be controlled by that\n> other setting, which was added by 1ecce722cd (hook: allow disabling\n> config hooks, 2026-02-19), which added \"diable\" specifically for\n> \"config hooks\", and the documentation from that addition says:\n>\n>     hook.<friendly-name>.enabled::\n> \tWhether the hook `hook.<name>` is enabled. Defaults to `true`.\n> \tSet to `false` to disable the hook without removing its\n> \tconfiguration. This is particularly useful when a hook is defined\n> \tin a system or global config file and needs to be disabled for a\n> \tspecific repository. See linkgit:git-hook[1].\n>\n> mentioning \"removing its configuration\", and \"defined in ... config\n> file\", to me, it is very clear that this configuration variable is\n> only about the hooks defined in the configuration system.\n>\n> Which tempts me to say that the change being discussed is a backward\n> incompatible breakage, rather than a bugfix.\n>\n> But casual end-users would of course do not know how the feature\n> evolved, and may not read the documentation of the feature they use\n> carefully enough.  So I dunno.  Perhaps changing the behaviour at\n> the same time updating the documentation to make it clear these\n> cover all kinds of hooks, not just the configuration-defined ones,\n> may be sufficient.\n\nAgreed, let's keep it simple.\n\n@Thomas, can you please send a v2 to update the documentation to make it\nclear that disabling the hook event disables both the config-defined\nhooks and the hookdir hooks for that event?\n\nJust a short mention like you specified in hook.h, to avoid any\nambiguity.\n\nMany thanks,\nAdrian\n\n"},{"id":"556024","messageId":"pull.2272.v2.git.1792761542.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":"pull.2272.git.1792520353.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] Two hook configuration changes","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-23T13:19:00Z","receivedAt":"2026-10-23T13:19:00Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"Two small changes to hook configuration. With the first,\nhook.pre-commit.enabled=false also stops the pre-commit hook in the hooks\ndirectory. With the second, hook.*.enabled and hook.*.parallel can be given\nwithout a value, which means true, as for any other boolean.\n\nChanges since v1:\n\n * The documentation of hook.<event>.enabled now says that it covers\n   configured hooks and the hook in the hooks directory alike. The subject\n   and message of patch 1 present this as a change in behavior rather than a\n   fix (Adrian, Junio).\n\n * The test that hook.<event>.enabled=false leaves the hooks of other events\n   alone now has a hookdir hook too.\n\nThomas Bachem (2):\n  hook: make hook.<event>.enabled cover the hookdir hook\n  hook: accept .enabled and .parallel given without a value\n\n Documentation/config/hook.adoc |  3 +-\n builtin/hook.c                 |  6 ++--\n hook.c                         | 17 ++++++----\n hook.h                         |  8 ++++-\n t/t1800-hook.sh                | 57 ++++++++++++++++++++++++++++++++--\n 5 files changed, 78 insertions(+), 13 deletions(-)\n\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2272%2Fthomasbachem%2Fhook-event-enabled-hookdir-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2272/thomasbachem/hook-event-enabled-hookdir-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2272\n\nRange-diff vs v1:\n\n 1:  1a7d060fae ! 1:  cfcbe80ba5 hook: honor hook.<event>.enabled for the hookdir hook\n     @@ Metadata\n      Author: Thomas Bachem <mail@thomasbachem.com>\n      \n       ## Commit message ##\n     -    hook: honor hook.<event>.enabled for the hookdir hook\n     +    hook: make hook.<event>.enabled cover the hookdir hook\n      \n     -    The documentation added by dcfb5af67e (hook: add hook.<event>.enabled\n     -    switch, 2026-04-10) says that with hook.<event>.enabled set to false\n     -    \"no hooks fire for that event\", but only hooks defined in the\n     -    configuration are skipped. With hook.pre-commit.enabled=false,\n     -    \"git commit\" still runs .git/hooks/pre-commit, and \"git hook list\"\n     -    shows that hook without the \"event-disabled\" mark.\n     +    hook.<event>.enabled, added by dcfb5af67e (hook: add\n     +    hook.<event>.enabled switch, 2026-04-10), skips only the hooks\n     +    defined in the configuration when set to false. With\n     +    hook.pre-commit.enabled=false, \"git commit\" still runs\n     +    .git/hooks/pre-commit, and \"git hook list\" shows that hook without\n     +    the \"event-disabled\" mark.\n      \n     -    Move the event_disabled flag out of u.configured in struct hook, set\n     -    it for the hookdir hook too, and check it for both kinds of hooks.\n     +    That was the intent, but the documentation says \"no hooks fire for\n     +    that event\", which reads as covering the hookdir hook too. No other\n     +    setting turns off the hookdir hook of a single event either:\n     +    core.hooksPath=/dev/null turns off the hookdir hooks of all events.\n     +    Make the switch cover the hookdir hook as well, and say so in the\n     +    documentation. This changes behavior for anyone who set the switch\n     +    and relied on the hookdir hook still running.\n      \n          The test for hook.<event>.enabled=false looks only at the standard\n          output, but \"git hook run\" sends hook output to the standard error,\n     @@ Commit message\n          Assisted-by: Claude Fable 5.1\n          Signed-off-by: Thomas Bachem <mail@thomasbachem.com>\n      \n     + ## Documentation/config/hook.adoc ##\n     +@@ Documentation/config/hook.adoc: hook.<friendly-name>.parallel::\n     + \tthe effective job count is greater than 1. {see-git-hook}\n     + \n     + hook.<event>.enabled::\n     +-\tSwitch to enable or disable all hooks for the `<event>` hook event.\n     ++\tSwitch to enable or disable all hooks for the `<event>` hook event,\n     ++\tconfigured hooks and the traditional hook in the hooks directory alike.\n     + \tWhen set to `false`, no hooks fire for that event, regardless of any\n     + \tper-hook `hook.<friendly-name>.enabled` settings. Defaults to `true`.\n     + \t{see-git-hook}\n     +\n       ## builtin/hook.c ##\n      @@ builtin/hook.c: static int list(int argc, const char **argv, const char *prefix,\n       \n     @@ t/t1800-hook.sh: test_expect_success 'hook.<event>.jobs rejects values less than\n       '\n       \n       test_expect_success 'hook.<event>.enabled=true does not suppress hooks' '\n     +@@ t/t1800-hook.sh: test_expect_success 'hook.<event>.enabled=true does not suppress hooks' '\n     + test_expect_success 'hook.<event>.enabled=false does not affect other events' '\n     + \ttest_config hook.hook-1.event test-hook &&\n     + \ttest_config hook.hook-1.command \"echo ran\" &&\n     ++\ttest_hook test-hook <<-\\EOF &&\n     ++\techo hookdir ran\n     ++\tEOF\n     + \ttest_config hook.other-event.enabled false &&\n     + \tgit hook run --allow-unknown-hook-name test-hook >out 2>err &&\n     +-\ttest_grep \"ran\" err\n     ++\ttest_grep \"^ran$\" err &&\n     ++\ttest_grep \"^hookdir ran$\" err\n     + '\n     + \n     + test_expect_success 'hook.<friendly-name>.enabled=false still disables that hook' '\n      @@ t/t1800-hook.sh: test_expect_success 'git hook list shows event-disabled hooks as event-disabled'\n       \ttest_config hook.hook-1.command \"echo ran\" &&\n       \ttest_config hook.hook-2.event test-hook &&\n 2:  3db167c9d1 = 2:  53a5a1787a hook: accept .enabled and .parallel given without a value\n\n-- \ngitgitgadget\n\n"},{"id":"556025","messageId":"cfcbe80ba5981f6aa2191fe004a3ff8f26b8d8cd.1792761542.git.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":"pull.2272.v2.git.1792761542.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] hook: make hook.<event>.enabled cover the hookdir hook","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-23T13:19:01Z","receivedAt":"2026-10-23T13:19:01Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"From: Thomas Bachem <mail@thomasbachem.com>\n\nhook.<event>.enabled, added by dcfb5af67e (hook: add\nhook.<event>.enabled switch, 2026-04-10), skips only the hooks\ndefined in the configuration when set to false. With\nhook.pre-commit.enabled=false, \"git commit\" still runs\n.git/hooks/pre-commit, and \"git hook list\" shows that hook without\nthe \"event-disabled\" mark.\n\nThat was the intent, but the documentation says \"no hooks fire for\nthat event\", which reads as covering the hookdir hook too. No other\nsetting turns off the hookdir hook of a single event either:\ncore.hooksPath=/dev/null turns off the hookdir hooks of all events.\nMake the switch cover the hookdir hook as well, and say so in the\ndocumentation. This changes behavior for anyone who set the switch\nand relied on the hookdir hook still running.\n\nThe test for hook.<event>.enabled=false looks only at the standard\noutput, but \"git hook run\" sends hook output to the standard error,\nso the test passes even when a disabled hook runs. Add a hookdir hook\nto it and check the standard error as well.\n\nAssisted-by: Claude Fable 5.1\nSigned-off-by: Thomas Bachem <mail@thomasbachem.com>\n---\n Documentation/config/hook.adoc |  3 ++-\n builtin/hook.c                 |  6 ++++--\n hook.c                         | 14 +++++++++-----\n hook.h                         |  8 +++++++-\n t/t1800-hook.sh                | 35 +++++++++++++++++++++++++++++++---\n 5 files changed, 54 insertions(+), 12 deletions(-)\n\ndiff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc\nindex 083dc60a13..332657e70f 100644\n--- a/Documentation/config/hook.adoc\n+++ b/Documentation/config/hook.adoc\n@@ -47,7 +47,8 @@ hook.<friendly-name>.parallel::\n \tthe effective job count is greater than 1. {see-git-hook}\n \n hook.<event>.enabled::\n-\tSwitch to enable or disable all hooks for the `<event>` hook event.\n+\tSwitch to enable or disable all hooks for the `<event>` hook event,\n+\tconfigured hooks and the traditional hook in the hooks directory alike.\n \tWhen set to `false`, no hooks fire for that event, regardless of any\n \tper-hook `hook.<friendly-name>.enabled` settings. Defaults to `true`.\n \t{see-git-hook}\ndiff --git a/builtin/hook.c b/builtin/hook.c\nindex cceeb3586e..1ea698ecc2 100644\n--- a/builtin/hook.c\n+++ b/builtin/hook.c\n@@ -82,7 +82,9 @@ static int list(int argc, const char **argv, const char *prefix,\n \n \t\tswitch (h->kind) {\n \t\tcase HOOK_TRADITIONAL:\n-\t\t\tprintf(\"%s%c\", _(\"hook from hookdir\"), line_terminator);\n+\t\t\tprintf(\"%s%s%c\",\n+\t\t\t       h->event_disabled ? \"event-disabled\\t\" : \"\",\n+\t\t\t       _(\"hook from hookdir\"), line_terminator);\n \t\t\tbreak;\n \t\tcase HOOK_CONFIGURED: {\n \t\t\tconst char *name = h->u.configured.friendly_name;\n@@ -95,7 +97,7 @@ static int list(int argc, const char **argv, const char *prefix,\n \t\t\t * \"disabled\" surfaces once the event is re-enabled.\n \t\t\t */\n \t\t\tconst char *disability =\n-\t\t\t\th->u.configured.event_disabled ? \"event-disabled\\t\" :\n+\t\t\t\th->event_disabled              ? \"event-disabled\\t\" :\n \t\t\t\th->u.configured.disabled       ? \"disabled\\t\"       :\n \t\t\t\t\t\t\t\t \"\";\n \t\t\tif (scope)\ndiff --git a/hook.c b/hook.c\nindex d10eef4763..5e756cb353 100644\n--- a/hook.c\n+++ b/hook.c\n@@ -115,6 +115,9 @@ static void list_hooks_add_default(struct repository *r, const char *hookname,\n \n \th->kind = HOOK_TRADITIONAL;\n \th->u.traditional.path = xstrdup(hook_path);\n+\t/* list_hooks_add_configured() has loaded r->disabled_events */\n+\th->event_disabled = !!unsorted_string_list_lookup(&r->disabled_events,\n+\t\t\t\t\t\t\t  hookname);\n \n \tstring_list_append(hook_list, hook_path)->util = h;\n }\n@@ -514,7 +517,7 @@ static void list_hooks_add_configured(struct repository *r,\n \t\t\tentry->command ? xstrdup(entry->command) : NULL;\n \t\thook->u.configured.scope = entry->scope;\n \t\thook->u.configured.disabled = entry->disabled;\n-\t\thook->u.configured.event_disabled = event_is_disabled;\n+\t\thook->event_disabled = event_is_disabled;\n \t\thook->parallel = entry->parallel;\n \n \t\tstring_list_append(list, friendly_name)->util = hook;\n@@ -559,8 +562,9 @@ int hook_exists(struct repository *r, const char *name)\n \n \tfor (size_t i = 0; i < hooks->nr; i++) {\n \t\tstruct hook *h = hooks->items[i].util;\n-\t\tif (h->kind == HOOK_TRADITIONAL ||\n-\t\t    (!h->u.configured.disabled && !h->u.configured.event_disabled)) {\n+\t\tif (!h->event_disabled &&\n+\t\t    (h->kind == HOOK_TRADITIONAL ||\n+\t\t     !h->u.configured.disabled)) {\n \t\t\texists = 1;\n \t\t\tbreak;\n \t\t}\n@@ -583,8 +587,8 @@ static int pick_next_hook(struct child_process *cp,\n \t\tif (hook_cb->hook_to_run_index >= hook_list->nr)\n \t\t\treturn 0;\n \t\th = hook_list->items[hook_cb->hook_to_run_index++].util;\n-\t} while (h->kind == HOOK_CONFIGURED &&\n-\t\t (h->u.configured.disabled || h->u.configured.event_disabled));\n+\t} while (h->event_disabled ||\n+\t\t (h->kind == HOOK_CONFIGURED && h->u.configured.disabled));\n \n \tcp->no_stdin = 1;\n \tstrvec_pushv(&cp->env, hook_cb->options->env.v);\ndiff --git a/hook.h b/hook.h\nindex 27bb1aeb2e..6af24cb331 100644\n--- a/hook.h\n+++ b/hook.h\n@@ -32,10 +32,16 @@ struct hook {\n \t\t\tconst char *command;\n \t\t\tenum config_scope scope;\n \t\t\tbool disabled;\n-\t\t\tbool event_disabled;\n \t\t} configured;\n \t} u;\n \n+\t/**\n+\t * Whether this hook's event is disabled with\n+\t * `hook.<event>.enabled = false`. This applies to configured hooks\n+\t * and the hookdir hook alike.\n+\t */\n+\tbool event_disabled;\n+\n \t/**\n \t * Whether this hook may run in parallel with other hooks for the same\n \t * event. Only useful for configured (named) hooks. Traditional hooks\ndiff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\nindex 7d4b2982b4..45b99a7f04 100755\n--- a/t/t1800-hook.sh\n+++ b/t/t1800-hook.sh\n@@ -496,6 +496,15 @@ test_expect_success 'disabled configured hook is not reported as existing by hoo\n \ttest_grep ! \"pre-commit\" git-bugreport-hook-exists-test.txt\n '\n \n+test_expect_success 'event-disabled hookdir hook is not reported as existing by hook_exists' '\n+\ttest_when_finished \"rm -f git-bugreport-hook-exists-test.txt\" &&\n+\tsetup_hookdir &&\n+\ttest_config hook.pre-commit.enabled false &&\n+\n+\tgit bugreport -s hook-exists-test &&\n+\ttest_grep ! \"pre-commit\" git-bugreport-hook-exists-test.txt\n+'\n+\n test_expect_success 'globally disabled hook can be re-enabled locally' '\n \ttest_config_global hook.global-hook.event \"test-hook\" &&\n \ttest_config_global hook.global-hook.command \"echo \\\"global-hook ran\\\"\" &&\n@@ -1110,9 +1119,13 @@ test_expect_success 'hook.<event>.jobs rejects values less than -1' '\n test_expect_success 'hook.<event>.enabled=false skips all hooks for event' '\n \ttest_config hook.hook-1.event test-hook &&\n \ttest_config hook.hook-1.command \"echo ran\" &&\n+\ttest_hook test-hook <<-\\EOF &&\n+\techo ran\n+\tEOF\n \ttest_config hook.test-hook.enabled false &&\n \tgit hook run --allow-unknown-hook-name test-hook >out 2>err &&\n-\ttest_must_be_empty out\n+\ttest_must_be_empty out &&\n+\ttest_must_be_empty err\n '\n \n test_expect_success 'hook.<event>.enabled=true does not suppress hooks' '\n@@ -1126,9 +1139,13 @@ test_expect_success 'hook.<event>.enabled=true does not suppress hooks' '\n test_expect_success 'hook.<event>.enabled=false does not affect other events' '\n \ttest_config hook.hook-1.event test-hook &&\n \ttest_config hook.hook-1.command \"echo ran\" &&\n+\ttest_hook test-hook <<-\\EOF &&\n+\techo hookdir ran\n+\tEOF\n \ttest_config hook.other-event.enabled false &&\n \tgit hook run --allow-unknown-hook-name test-hook >out 2>err &&\n-\ttest_grep \"ran\" err\n+\ttest_grep \"^ran$\" err &&\n+\ttest_grep \"^hookdir ran$\" err\n '\n \n test_expect_success 'hook.<friendly-name>.enabled=false still disables that hook' '\n@@ -1147,10 +1164,14 @@ test_expect_success 'git hook list shows event-disabled hooks as event-disabled'\n \ttest_config hook.hook-1.command \"echo ran\" &&\n \ttest_config hook.hook-2.event test-hook &&\n \ttest_config hook.hook-2.command \"echo ran\" &&\n+\ttest_hook test-hook <<-\\EOF &&\n+\techo ran\n+\tEOF\n \ttest_config hook.test-hook.enabled false &&\n \tgit hook list --allow-unknown-hook-name test-hook >actual &&\n \ttest_grep \"^event-disabled\thook-1$\" actual &&\n-\ttest_grep \"^event-disabled\thook-2$\" actual\n+\ttest_grep \"^event-disabled\thook-2$\" actual &&\n+\ttest_grep \"^event-disabled\thook from hookdir$\" actual\n '\n \n test_expect_success 'git hook list shows scope with event-disabled' '\n@@ -1169,6 +1190,14 @@ test_expect_success 'git hook list still shows hooks when event is disabled' '\n \ttest_grep \"event-disabled\" actual\n '\n \n+test_expect_success 'commit skips the hookdir hook with hook.pre-commit.enabled=false' '\n+\ttest_hook pre-commit <<-\\EOF &&\n+\texit 1\n+\tEOF\n+\ttest_must_fail git commit --allow-empty -m blocked &&\n+\tgit -c hook.pre-commit.enabled=false commit --allow-empty -m allowed\n+'\n+\n test_expect_success 'friendly-name matching known event name is rejected' '\n \ttest_config hook.pre-commit.event pre-commit &&\n \ttest_config hook.pre-commit.command \"echo oops\" &&\n-- \ngitgitgadget\n\n\n"},{"id":"556026","messageId":"53a5a1787acd97e0233ba48b46162089de6fcd3a.1792761542.git.gitgitgadget@gmail.com","threadId":"66606","inReplyTo":"pull.2272.v2.git.1792761542.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] hook: accept .enabled and .parallel given without a value","fromName":"Thomas Bachem via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-23T13:19:02Z","receivedAt":"2026-10-23T13:19:02Z","isPatch":true,"sender":{"key":"mail@thomasbachem.com","avatar":"https://gravatar.com/avatar/e9bc28172fe03ca6777b6d330a8503511d84bde14ce0e84c962d2b3b39ed3db1?d=mp&s=160"},"body":"From: Thomas Bachem <mail@thomasbachem.com>\n\nhook.<name>.enabled and hook.<name>.parallel are booleans, and\ngit-config(1) documents a boolean without a value as true. But\nhook_config_lookup_all() rejects every hook.<name>.<key> that has no\nvalue, so \"git -c hook.lint.parallel hook run pre-commit\" fails with\n\"missing value for 'hook.lint.parallel'\", and so does a bare\n\"parallel\" under [hook \"lint\"]. The same happens with .enabled, for a\nhook as well as for an event.\n\nKeep rejecting a missing value for the other keys. For .enabled and\n.parallel, pass it to git_parse_maybe_bool(), which takes it as true.\n\nAssisted-by: Claude Fable 5.1\nSigned-off-by: Thomas Bachem <mail@thomasbachem.com>\n---\n hook.c          |  3 ++-\n t/t1800-hook.sh | 22 ++++++++++++++++++++++\n 2 files changed, 24 insertions(+), 1 deletion(-)\n\ndiff --git a/hook.c b/hook.c\nindex 5e756cb353..c500fec33e 100644\n--- a/hook.c\n+++ b/hook.c\n@@ -184,7 +184,8 @@ static int hook_config_lookup_all(const char *key, const char *value,\n \t\treturn 0;\n \t}\n \n-\tif (!value)\n+\t/* .enabled and .parallel are bools, where a missing value means true */\n+\tif (!value && strcmp(subkey, \"enabled\") && strcmp(subkey, \"parallel\"))\n \t\treturn config_error_nonbool(key);\n \n \t/* Extract name, ensuring it is null-terminated. */\ndiff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\nindex 45b99a7f04..fca4cfc712 100755\n--- a/t/t1800-hook.sh\n+++ b/t/t1800-hook.sh\n@@ -516,6 +516,17 @@ test_expect_success 'globally disabled hook can be re-enabled locally' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'hook.<friendly-name>.enabled without a value means true' '\n+\ttest_config_global hook.global-hook.event \"test-hook\" &&\n+\ttest_config_global hook.global-hook.command \"echo \\\"global-hook ran\\\"\" &&\n+\ttest_config_global hook.global-hook.enabled false &&\n+\n+\techo \"global-hook ran\" >expected &&\n+\tgit -c hook.global-hook.enabled \\\n+\t\thook run --allow-unknown-hook-name test-hook 2>actual &&\n+\ttest_cmp expected actual\n+'\n+\n test_expect_success 'configured hooks run before hookdir hook' '\n \tsetup_hookdir &&\n \ttest_config hook.first.event \"pre-commit\" &&\n@@ -1080,6 +1091,17 @@ test_expect_success 'hook.jobs=-1 resolves to online_cpus()' '\n \ttest_grep \"\\\"region_enter\\\".*\\\"hook\\\".*\\\"test-hook\\\".*\\\"max:$cpus\\\"\" trace.txt\n '\n \n+test_expect_success 'hook.<friendly-name>.parallel without a value means true' '\n+\ttest_config hook.hook-1.event test-hook &&\n+\ttest_config hook.hook-1.command \"true\" &&\n+\ttest_config hook.jobs 2 &&\n+\n+\tGIT_TRACE2_EVENT=\"$(pwd)/trace-parallel.txt\" \\\n+\t\tgit -c hook.hook-1.parallel \\\n+\t\thook run --allow-unknown-hook-name test-hook >out 2>err &&\n+\ttest_grep \"\\\"region_enter\\\".*\\\"hook\\\".*\\\"test-hook\\\".*\\\"max:2\\\"\" trace-parallel.txt\n+'\n+\n test_expect_success 'hook.<event>.jobs=-1 resolves to online_cpus()' '\n \ttest_config hook.hook-1.event test-hook &&\n \ttest_config hook.hook-1.command \"true\" &&\n-- \ngitgitgadget\n\n"},{"id":"556085","messageId":"xmqqh5ic7174.fsf@gitster.g","threadId":"66606","inReplyTo":"pull.2272.v2.git.1792761542.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/2] Two hook configuration changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-23T17:53:51Z","receivedAt":"2026-10-23T17:53:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Thomas Bachem via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Two small changes to hook configuration. With the first,\n> hook.pre-commit.enabled=false also stops the pre-commit hook in the hooks\n> directory. With the second, hook.*.enabled and hook.*.parallel can be given\n> without a value, which means true, as for any other boolean.\n>\n> Changes since v1:\n>\n>  * The documentation of hook.<event>.enabled now says that it covers\n>    configured hooks and the hook in the hooks directory alike. The subject\n>    and message of patch 1 present this as a change in behavior rather than a\n>    fix (Adrian, Junio).\n>\n>  * The test that hook.<event>.enabled=false leaves the hooks of other events\n>    alone now has a hookdir hook too.\n>\n> Thomas Bachem (2):\n>   hook: make hook.<event>.enabled cover the hookdir hook\n>   hook: accept .enabled and .parallel given without a value\n\nThanks, the range-diff looks good.  Will queue.\n\n\n"}]}