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>
This commit is contained in:
Alex Riesen 2021-10-29 15:45:45 +02:00 committed by Junio C Hamano
parent e9e5ba39a7
commit fa21296b58
3 changed files with 14 additions and 4 deletions

View File

@ -212,8 +212,9 @@ include::signoff-option.txt[]
each trailer would appear, and other details.
-n::
--no-verify::
This option bypasses the pre-commit and commit-msg hooks.
--[no-]verify::
By default, the pre-commit and commit-msg hooks are run.
When any of `--no-verify` or `-n` is given, these are bypassed.
See also linkgit:githooks[5].
--allow-empty::

View File

@ -132,8 +132,9 @@ ifdef::git-pull[]
Only useful when merging.
endif::git-pull[]
--no-verify::
This option bypasses the pre-merge and commit-msg hooks.
--[no-]verify::
By default, the pre-merge and commit-msg hooks are run.
When `--no-verify` is given, these are bypassed.
See also linkgit:githooks[5].
ifdef::git-pull[]
Only useful when merging.

View File

@ -133,6 +133,14 @@ test_expect_success '--no-verify with failing hook' '
'
test_expect_success '-n followed by --verify with failing hook' '
echo "even more" >> file &&
git add file &&
test_must_fail git commit -n --verify -m "even more"
'
test_expect_success '--no-verify with failing hook (editor)' '
echo "more stuff" >> file &&