diff options
| author | Adrian Ratiu <adrian.ratiu@collabora.com> | 2026-04-10 12:06:06 +0300 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-10 07:58:54 -0700 |
| commit | dcfb5af67e7d7156c4d1ede66de18088c990356c (patch) | |
| tree | 0ba00e571d8054189f5b17f14678492f6bd854a8 /t/t4013/diff.format-patch_--inline_--stdout_initial..master^ | |
| parent | 2eb541e8f2a9b0dd923279421c741d0a0c00420d (diff) | |
| download | git-dcfb5af67e7d7156c4d1ede66de18088c990356c.tar.gz git-dcfb5af67e7d7156c4d1ede66de18088c990356c.zip | |
hook: add hook.<event>.enabled switch
Add a hook.<event>.enabled config key that disables all hooks for
a given event, when set to false, acting as a high-level switch
above the existing per-hook hook.<friendly-name>.enabled.
Event-disabled hooks are shown in "git hook list" with an
"event-disabled" tab-separated prefix before the name:
$ git hook list test-hook
event-disabled hook-1
event-disabled hook-2
With --show-scope:
$ git hook list --show-scope test-hook
local event-disabled hook-1
When a hook is both per-hook disabled and event-disabled, only
"event-disabled" is shown: the event-level switch is the more
relevant piece of information, and the per-hook "disabled" status
will surface once the event is re-enabled.
Using an event name as a friendly-name (e.g. hook.<event>.enabled)
can cause ambiguity, so a fatal error is issued when using a known
event name and a warning is issued for unknown event name, since
a collision cannot be detected with certainty for unknown events.
Suggested-by: Patrick Steinhardt <ps@pks.im>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.format-patch_--inline_--stdout_initial..master^')
0 files changed, 0 insertions, 0 deletions
