blob: 1e88c0fb255376ee557f7ec89f66946835c5c6f5 [file] [log] [blame]
hook.<friendly-name>.command::
The command to execute for `hook.<friendly-name>`. `<friendly-name>`
is a unique name that identifies this hook. The hook events that
trigger the command are configured with `hook.<friendly-name>.event`.
The value can be an executable path or a shell oneliner. If more than
one value is specified for the same `<friendly-name>`, only the last
value parsed is used. See linkgit:git-hook[1].
hook.<friendly-name>.event::
The hook events that trigger `hook.<friendly-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.<friendly-name>.command` is executed.
This is a multi-valued key. To run `hook.<friendly-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.<friendly-name>`. See linkgit:git-hook[1].
hook.<friendly-name>.enabled::
Whether the hook `hook.<friendly-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].
hook.<name>.parallel::
Whether the hook `hook.<name>` may run in parallel with other hooks
for the same event. Defaults to `false`. Set to `true` only when the
hook script is safe to run concurrently with other hooks for the same
event. If any hook for an event does not have this set to `true`,
all hooks for that event run sequentially regardless of `hook.jobs`.
Only configured (named) hooks need to declare this. Traditional hooks
found in the hooks directory do not need to, and run in parallel when
the effective job count is greater than 1. See linkgit:git-hook[1].
hook.<event>.jobs::
Specifies how many hooks can be run simultaneously for the `<event>`
hook event (e.g. `hook.post-receive.jobs = 4`). Overrides `hook.jobs`
for this specific event. The same parallelism restrictions apply: this
setting has no effect unless all configured hooks for the event have
`hook.<friendly-name>.parallel` set to `true`. Must be a positive int,
zero is rejected with a warning. See linkgit:git-hook[1].
+
Note on naming: although this key resembles `hook.<friendly-name>.*`
(a per-hook setting), `<event>` must be the event name, not a hook
friendly name. The key component is stored literally and looked up by
event name at runtime with no translation between the two namespaces.
A key like `hook.my-hook.jobs` is stored under `"my-hook"` but the
lookup at runtime uses the event name (e.g. `"post-receive"`), so
`hook.my-hook.jobs` is silently ignored even when `my-hook` is
registered for that event. Use `hook.post-receive.jobs` or any other
valid event name when setting `hook.<event>.jobs`.
hook.jobs::
Specifies how many hooks can be run simultaneously during parallelized
hook execution. If unspecified, defaults to 1 (serial execution).
Can be overridden on a per-event basis with `hook.<event>.jobs`.
Some hooks always run sequentially regardless of this setting because
git knows they cannot safely be parallelized: `applypatch-msg`,
`pre-commit`, `prepare-commit-msg`, `commit-msg`, `post-commit`,
`post-checkout`, and `push-to-checkout`.
+
This setting has no effect unless all configured hooks for the event have
`hook.<name>.parallel` set to `true`.
+
This has no effect for hooks requiring separate output streams (like `pre-push`)
unless `extensions.hookStdoutToStderr` is enabled.
hook.forceStdoutToStderr::
A boolean that enables the `extensions.hookStdoutToStderr` behavior
(merging stdout to stderr for all hooks) globally. This effectively
forces all hooks to behave as if the extension was enabled, allowing
parallel execution for hooks like `pre-push`.