Skip to content

Commit fa21296

Browse files
raalkmlgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9e5ba3 commit fa21296

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Documentation/git-commit.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ include::signoff-option.txt[]
212212
each trailer would appear, and other details.
213213

214214
-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.
217218
See also linkgit:githooks[5].
218219

219220
--allow-empty::

Documentation/merge-options.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ ifdef::git-pull[]
132132
Only useful when merging.
133133
endif::git-pull[]
134134

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.
137138
See also linkgit:githooks[5].
138139
ifdef::git-pull[]
139140
Only useful when merging.

t/t7504-commit-msg-hook.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ test_expect_success '--no-verify with failing hook' '
133133
134134
'
135135

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+
136144
test_expect_success '--no-verify with failing hook (editor)' '
137145
138146
echo "more stuff" >> file &&

0 commit comments

Comments
 (0)