aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2025-12-26 14:23:30 +0200
committerJunio C Hamano <gitster@pobox.com>2025-12-28 14:02:07 +0900
commit857f047e40f796aa43c6e7c754d8a32ee64e4f4d (patch)
tree13d33095076988fd728fcb68e1e624c4e1f086f9 /builtin
parent7a7717427ea7253003d221c47b462d9334429053 (diff)
downloadgit-857f047e40f796aa43c6e7c754d8a32ee64e4f4d.tar.xz
hook: allow overriding the ungroup option
When calling run_process_parallel() in run_hooks_opt(), the ungroup option is currently hardcoded to .ungroup = 1. This causes problems when ungrouping should be disabled, for example when sideband-reading collated output from child hooks, because sideband-reading and ungrouping are mutually exclusive. Thus a new hook.h option is added to allow overriding. The existing ungroup=1 behavior is preserved in the run_hooks() API and the "hook run" command. We could modify these to take an option if necessary, so I added two code comments there. Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/hook.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/hook.c b/builtin/hook.c
index 7afec380d2..73e7b8c2e8 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -44,6 +44,12 @@ static int run(int argc, const char **argv, const char *prefix,
goto usage;
/*
+ * All current "hook run" use-cases require ungrouped child output.
+ * If this changes, a hook run argument can be added to toggle it.
+ */
+ opt.ungroup = 1;
+
+ /*
* Having a -- for "run" when providing <hook-args> is
* mandatory.
*/