diff options
author | Emily Shaffer <emilyshaffer@google.com> | 2023-02-08 20:21:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-08 21:50:03 +0100 |
commit | 0414b3891cd3adb80b879c7be49d9b727e2b23f5 (patch) | |
tree | 571727f667d789f1041ea5ba2116c9691f71f387 /Documentation | |
parent | sequencer: use the new hook API for the simpler "post-rewrite" call (diff) | |
download | git-0414b3891cd3adb80b879c7be49d9b727e2b23f5.tar.xz git-0414b3891cd3adb80b879c7be49d9b727e2b23f5.zip |
hook: support a --to-stdin=<path> option
Expose the "path_to_stdin" API added in the preceding commit in the
"git hook run" command.
For now we won't be using this command interface outside of the tests,
but exposing this functionality makes it easier to test the hook
API. The plan is to use this to extend the "sendemail-validate"
hook[1][2].
1. https://lore.kernel.org/git/ad152e25-4061-9955-d3e6-a2c8b1bd24e7@amd.com
2. https://lore.kernel.org/git/20230120012459.920932-1-michael.strawbridge@amd.com
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>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-hook.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-hook.txt b/Documentation/git-hook.txt index 77c3a8ad90..3407f3c2c0 100644 --- a/Documentation/git-hook.txt +++ b/Documentation/git-hook.txt @@ -8,7 +8,7 @@ git-hook - Run git hooks SYNOPSIS -------- [verse] -'git hook' run [--ignore-missing] <hook-name> [-- <hook-args>] +'git hook' run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>] DESCRIPTION ----------- @@ -31,6 +31,11 @@ linkgit:githooks[5] for arguments hooks might expect (if any). OPTIONS ------- +--to-stdin:: + For "run"; Specify a file which will be streamed into the + hook's stdin. The hook will receive the entire file from + beginning to EOF. + --ignore-missing:: Ignore any missing hook by quietly returning zero. Used for tools that want to do a blind one-shot run of a hook that may |