hook: mark non-parallelizable hooks

Several hooks are known to be inherently non-parallelizable, so initialize
them with RUN_HOOKS_OPT_INIT_FORCE_SERIAL. This pins jobs=1 and overrides
any hook.jobs or runtime -j flags.

These hooks are:
applypatch-msg, pre-commit, prepare-commit-msg, commit-msg, post-commit,
post-checkout, and push-to-checkout.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Emily Shaffer
2026-02-22 02:29:00 +02:00
committed by Junio C Hamano
parent b72153d36e
commit 4744a38c6b
8 changed files with 46 additions and 14 deletions

View File

@@ -1957,7 +1957,7 @@ size_t ignored_log_message_bytes(const char *buf, size_t len)
int run_commit_hook(int editor_is_used, const char *index_file,
int *invoked_hook, const char *name, ...)
{
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT_FORCE_SERIAL;
va_list args;
const char *arg;