Re: [PATCH v4 2/9] hook: parse the hook.jobs config
- From
Adrian Ratiu <adrian.ratiu@collabora.com>
- Date
- Mar 24, 2026, 18:59 UTC
- Message-ID
- <87jyv1cau6.fsf@collabora.com>
- In-Reply-To
- <acJUXq7cMKG6KExe@pks.im>
On Tue, 24 Mar 2026, Patrick Steinhardt <ps@pks.im> wrote:
Show 19 quoted lines
> On Fri, Mar 20, 2026 at 03:53:04PM +0200, Adrian Ratiu wrote: >> diff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc >> index 9e78f26439..b7847f9338 100644 >> --- a/Documentation/config/hook.adoc >> +++ b/Documentation/config/hook.adoc >> @@ -22,3 +22,7 @@ hook.<friendly-name>.enabled:: >> 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.jobs:: >> + Specifies how many hooks can be run simultaneously during parallelized >> + hook execution. If unspecified, defaults to 1 (serial execution). > > I was wondering whether we also want to allow -1 as a way to say "use as > many jobs as I have CPU cores". We also do this in some other places. > > Totally fine to ignore this for now though, we can still add it at a > later point in time once somebody complains.
Yes, we can do this.
I already had the "use as many cpu cores as availble" logic in v1, within a different context which I dropped, so it shouldn't be too hard to add it back when hook.jobs == -1.
This is actually much cleaner than what we had in v1.
I'll do this in the next re-roll. Thanks!