aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-hook.txt
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-12-22 04:59:37 +0100
committerJunio C Hamano <gitster@pobox.com>2022-01-07 15:19:34 -0800
commit0d3979c175054187a4bd94dbbdc4f99300f7fc04 (patch)
tree9e89dd54a2e0b2776d504de9ca9d9fb6a66c450d /Documentation/git-hook.txt
parent1a3017d908824ab42ca7a5af7073f4cdc5c88fbf (diff)
downloadgit-0d3979c175054187a4bd94dbbdc4f99300f7fc04.tar.gz
git hook run: add an --ignore-missing flag
For certain one-shot hooks we'd like to optimistically run them, and not complain if they don't exist. This was already supported by the underlying hook.c library, but had not been exposed via "git hook run". The command version of this will be used by send-email in a subsequent commit. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-hook.txt')
-rw-r--r--Documentation/git-hook.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/git-hook.txt b/Documentation/git-hook.txt
index e39b1b5d06..77c3a8ad90 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 <hook-name> [-- <hook-args>]
+'git hook' run [--ignore-missing] <hook-name> [-- <hook-args>]
DESCRIPTION
-----------
@@ -28,6 +28,14 @@ Any positional arguments to the hook should be passed after a
mandatory `--` (or `--end-of-options`, see linkgit:gitcli[7]). See
linkgit:githooks[5] for arguments hooks might expect (if any).
+OPTIONS
+-------
+
+--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
+ or may not be present.
+
SEE ALSO
--------
linkgit:githooks[5]