Document positive variant of commit and merge option "--no-verify"

This documents "--verify" option of the commands. It can be used to re-enable the hooks disabled by an earlier "--no-verify" in command-line. Signed-off-by: Alexander Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alex Riesen committed Oct 29, 2021 at 15:45 UTC fa21296b58e5b2c865a3974e5f03b65f4026c510
3 files changed +14 -4
Documentation/git-commit.txt
+3 -2
@@ -212,8 +212,9 @@ include::signoff-option.txt[]
212 each trailer would appear, and other details.
213
214 -n::
215 ---no-verify::
216 - This option bypasses the pre-commit and commit-msg hooks.
215 +--[no-]verify::
216 + By default, the pre-commit and commit-msg hooks are run.
217 + When any of `--no-verify` or `-n` is given, these are bypassed.
218 See also linkgit:githooks[5].
219
220 --allow-empty::
Documentation/merge-options.txt
+3 -2
@@ -132,8 +132,9 @@ ifdef::git-pull[]
132 Only useful when merging.
133 endif::git-pull[]
134
135 ---no-verify::
136 - This option bypasses the pre-merge and commit-msg hooks.
135 +--[no-]verify::
136 + By default, the pre-merge and commit-msg hooks are run.
137 + When `--no-verify` is given, these are bypassed.
138 See also linkgit:githooks[5].
139 ifdef::git-pull[]
140 Only useful when merging.
t/t7504-commit-msg-hook.sh
+8
@@ -133,6 +133,14 @@ test_expect_success '--no-verify with failing hook' '
133
134 '
135
136 +test_expect_success '-n followed by --verify with failing hook' '
137 +
138 + echo "even more" >> file &&
139 + git add file &&
140 + test_must_fail git commit -n --verify -m "even more"
141 +
142 +'
143 +
144 test_expect_success '--no-verify with failing hook (editor)' '
145
146 echo "more stuff" >> file &&