Re: [PATCH v4 7/9] hook: add per-event jobs config
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 24, 2026, 09:08 UTC
- Message-ID
- <acJUcIa9JerWgxI2@pks.im>
- In-Reply-To
- <20260320135311.331463-8-adrian.ratiu@collabora.com>
On Fri, Mar 20, 2026 at 03:53:09PM +0200, Adrian Ratiu wrote:
Show 25 quoted lines
> diff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc > index 6f60775c28..d4fa29d936 100644 > --- a/Documentation/config/hook.adoc > +++ b/Documentation/config/hook.adoc > @@ -33,9 +33,28 @@ hook.<friendly-name>.parallel:: > 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`.
This makes sense of course, but it feels like something that might be a bit confusing for end users. It would be great to have an explicit check for whether or not "hook.<friendly-name>.jobs" exists so that we can print a warning if so.
Patrick