mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
hooks: allow callers to capture output
Some server-side hooks will require capturing output to send over sideband instead of printing directly to stderr. Expose that capability. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5ab5872a53
commit
53254bfa1b
1
hook.c
1
hook.c
@ -158,6 +158,7 @@ int run_hooks_opt(struct repository *r, const char *hook_name,
|
|||||||
.get_next_task = pick_next_hook,
|
.get_next_task = pick_next_hook,
|
||||||
.start_failure = notify_start_failure,
|
.start_failure = notify_start_failure,
|
||||||
.feed_pipe = options->feed_pipe,
|
.feed_pipe = options->feed_pipe,
|
||||||
|
.consume_output = options->consume_output,
|
||||||
.task_finished = notify_hook_finished,
|
.task_finished = notify_hook_finished,
|
||||||
|
|
||||||
.data = &cb_data,
|
.data = &cb_data,
|
||||||
|
|||||||
8
hook.h
8
hook.h
@ -80,6 +80,14 @@ struct run_hooks_opt
|
|||||||
* Only useful when using `run_hooks_opt.feed_pipe`, otherwise ignore it.
|
* Only useful when using `run_hooks_opt.feed_pipe`, otherwise ignore it.
|
||||||
*/
|
*/
|
||||||
void *feed_pipe_cb_data;
|
void *feed_pipe_cb_data;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Populate this to capture output and prevent it from being printed to
|
||||||
|
* stderr. This will be passed directly through to
|
||||||
|
* run_command:run_parallel_processes(). See t/helper/test-run-command.c
|
||||||
|
* for an example.
|
||||||
|
*/
|
||||||
|
consume_output_fn consume_output;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RUN_HOOKS_OPT_INIT { \
|
#define RUN_HOOKS_OPT_INIT { \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user