aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/hook.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-22 14:55:45 -0800
committerJunio C Hamano <gitster@pobox.com>2023-02-22 14:55:45 -0800
commit5048df67b295baeaaa6dafb16ff712bd2a62731a (patch)
tree3c1325ae2d6ddb123323fc30452dd56043e66c51 /builtin/hook.c
parentMerge branch 'ab/various-leak-fixes' (diff)
parenthook: support a --to-stdin=<path> option (diff)
downloadgit-5048df67b295baeaaa6dafb16ff712bd2a62731a.tar.gz
git-5048df67b295baeaaa6dafb16ff712bd2a62731a.zip
Merge branch 'ab/hook-api-with-stdin'
Extend the run-hooks API to allow feeding data from the standard input when running the hook script(s). * ab/hook-api-with-stdin: hook: support a --to-stdin=<path> option sequencer: use the new hook API for the simpler "post-rewrite" call hook API: support passing stdin to hooks, convert am's 'post-rewrite' run-command: allow stdin for run_processes_parallel run-command.c: remove dead assignment in while-loop
Diffstat (limited to 'builtin/hook.c')
-rw-r--r--builtin/hook.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/hook.c b/builtin/hook.c
index b6530d189a..f95b7965c5 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -7,7 +7,7 @@
#include "strvec.h"
#define BUILTIN_HOOK_RUN_USAGE \
- N_("git hook run [--ignore-missing] <hook-name> [-- <hook-args>]")
+ N_("git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>]")
static const char * const builtin_hook_usage[] = {
BUILTIN_HOOK_RUN_USAGE,
@@ -28,6 +28,8 @@ static int run(int argc, const char **argv, const char *prefix)
struct option run_options[] = {
OPT_BOOL(0, "ignore-missing", &ignore_missing,
N_("silently ignore missing requested <hook-name>")),
+ OPT_STRING(0, "to-stdin", &opt.path_to_stdin, N_("path"),
+ N_("file to read into hooks' stdin")),
OPT_END(),
};
int ret;