Re: [PATCH v2 01/10] run-command: add stdin callback for parallelization
On Fri, Oct 17, 2025 at 05:15:35PM +0300, Adrian Ratiu wrote:
Show 13 quoted lines
> diff --git a/run-command.c b/run-command.c
> index ed9575bd6a..5bc6db5bb1 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -1652,6 +1652,44 @@ static int pp_start_one(struct parallel_processes *pp,
> return 0;
> }
>
> +static void pp_buffer_stdin(struct parallel_processes *pp,
> + const struct run_process_parallel_opts *opts)
> +{
> + /* Buffer stdin for each pipe. */
> + for (ssize_t i = 0; i < opts->processes; i++) {This should use `size_t` to match the type of `opts->processes`.
Show 17 quoted lines
> diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
> index 3719f23cc2..dfdb03b3ab 100644
> --- a/t/helper/test-run-command.c
> +++ b/t/helper/test-run-command.c
> @@ -54,15 +61,48 @@ static int no_job(struct child_process *cp UNUSED,
> static int task_finished(int result UNUSED,
> struct strbuf *err,
> void *pp_cb UNUSED,
> - void *pp_task_cb UNUSED)
> + void *pp_task_cb)
> {
> if (err)
> strbuf_addstr(err, "asking for a quick stop\n");
> else
> fprintf(stderr, "asking for a quick stop\n");
> + if (pp_task_cb)
> + FREE_AND_NULL(pp_task_cb);Tiny nit: the conditional here is not needed.
Show 10 quoted lines
> return 1;
> }
>
> +static int task_finished_quiet(int result UNUSED,
> + struct strbuf *err UNUSED,
> + void *pp_cb UNUSED,
> + void *pp_task_cb)
> +{
> + if (pp_task_cb)
> + FREE_AND_NULL(pp_task_cb);