Subject: Re: [PATCH v4 03/11] hook: provide stdin via callback

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 16 Dec 2025 09:08:22 +0100

On Thu, Dec 04, 2025 at 04:15:27PM +0200, Adrian Ratiu wrote:
> diff --git a/hook.h b/hook.h
> index 11863fa734..51cab785ea 100644
> --- a/hook.h
> +++ b/hook.h
> @@ -37,6 +38,43 @@ struct run_hooks_opt
>  	 * Path to file which should be piped to stdin for each hook.
>  	 */
>  	const char *path_to_stdin;
> +
> +	/**
> +	 * Callback used to incrementally feed a child hook stdin pipe.
> +	 *
> +	 * Useful especially if a hook consumes large quantities of data
> +	 * (e.g. a list of all refs in a client push), so feeding it via
> +	 * in-memory strings or slurping to/from files is inefficient.
> +	 * While the callback allows piecemeal writing, it can also be
> +	 * used for smaller inputs, where it gets called only once.
> +	 *
> +	 * Add hook callback initalization context to `feed_pipe_ctx`.
> +	 * Add Hook callback internal state to `feed_pipe_cb_data`.

Tiniest nit just to prove that I'm somewhat paying attention:
s/Hook/hook/. This definitely doesn't warrant a reroll.

Patrick