Files
Adrian Ratiu d084fa2a91 hook: allow event = "" to overwrite previous values
Add the ability for empty events to clear previously set multivalue
variables, so the newly added "hook.*.event" behave like the other
multivalued keys.

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>
2026-02-19 13:23:41 -08:00

25 lines
1.2 KiB
Plaintext

hook.<name>.command::
The command to execute for `hook.<name>`. `<name>` is a unique
"friendly" name that identifies this hook. (The hook events that
trigger the command are configured with `hook.<name>.event`.) The
value can be an executable path or a shell oneliner. If more than
one value is specified for the same `<name>`, only the last value
parsed is used. See linkgit:git-hook[1].
hook.<name>.event::
The hook events that trigger `hook.<name>`. The value is the name
of a hook event, like "pre-commit" or "update". (See
linkgit:githooks[5] for a complete list of hook events.) On the
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. An empty value resets
the list of events, clearing any previously defined events for
`hook.<name>`. 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].