]> git.ipfire.org Git - thirdparty/git.git/commit
run-command: add stdin callback for parallelization
authorEmily Shaffer <emilyshaffer@google.com>
Fri, 26 Dec 2025 12:23:25 +0000 (14:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jan 2026 21:10:29 +0000 (13:10 -0800)
commit6e2e7f6c1e4722e451168e1ca4f04d139ff758b0
treed4431c4cb7d688183ef29ba6d4651f481078c733
parentce3ae8073d190174028364fcd9af405b57795fb2
run-command: add stdin callback for parallelization

If a user of the run_processes_parallel() API wants to pipe a large
amount of information to the stdin of each parallel command, that
data could exceed the pipe buffer of the process's stdin and can be
too big to store in-memory via strbuf & friends or to slurp to a file.

Generally this is solved by repeatedly writing to child_process.in
between calls to start_command() and finish_command(). For a specific
pre-existing example of this, see transport.c:run_pre_push_hook().

This adds a generic callback API to run_processes_parallel() to do
exactly that in a unified manner, similar to the existing callback APIs,
which can then be used by hooks.h to convert the remaining hooks to the
new, simpler parallel interface.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c
run-command.h
t/helper/test-run-command.c
t/t0061-run-command.sh