]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Document positive variant of commit and merge option "--no-verify"
authorAlex Riesen <raa.lkml@gmail.com>
Fri, 29 Oct 2021 13:45:45 +0000 (15:45 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Oct 2021 18:22:56 +0000 (11:22 -0700)
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>
Documentation/git-commit.txt
Documentation/merge-options.txt
t/t7504-commit-msg-hook.sh

index 95fec5f0699046ebc36b8d30137640b3fb04be8c..6c60bf98f9f73ad9a892337c23c5a7f9b31b3eec 100644 (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::
index 61ec157c2f38b4b89039403c334edce10f8303d1..d8f7cd7ca017f4a257129e19ea7ce407aad5c3e8 100644 (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.
index 4e7592522a4a7b6f3f01034c40d52dd18699b7a2..bba58f04806fdfc247c1b72112ed6805340934c1 100755 (executable)
@@ -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 &&