Skip to content

Commit 2b64708

Browse files
committed
Merge branch 'ar/no-verify-doc'
Doc update. * ar/no-verify-doc: Document positive variant of commit and merge option "--no-verify"
2 parents a876f0b + fa21296 commit 2b64708

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)