Skip to content

Commit

Permalink
Updated multiple-invocations comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TekWizely committed Jul 1, 2019
1 parent 89f275f commit 0cacfe3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ Currently, directory-based hooks DO NOT accept user-args.
- ``*-pkg-*`` : Hook runs using `'$(go list)/$(dirname $FILE)` as target.

#### Multiple Hook Invocations
By design, the directory-based hooks only execute against a given directory once per hook invocation. HOWEVER, due to OS command-line length limits, Pre-Commit can invoke a hook multiple times if a large number of files are staged.
By design, the directory-based hooks only execute against a given directory once per hook invocation.

HOWEVER, due to OS command-line length limits, Pre-Commit can invoke a hook multiple times if a large number of files are staged.

--------------------
### Repo-Based Hooks
Expand Down
12 changes: 6 additions & 6 deletions sample-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ repos:
# Currently, directory-based hooks DO NOT accept user-args.
#
# Directory-Hook Suffixes:
# *-dir-* : Hook runs with './$(dirname $FILE)' as target.
# *-pkg-* : Hook runs with ''$(go list)/$(dirname $FILE)' as target.
# *-dir-* : Hook runs using './$(dirname $FILE)' as target.
# *-pkg-* : Hook runs using ''$(go list)/$(dirname $FILE)' as target.
#
# ! Multiple Hook Invocations by Pre-Commit
# ! Multiple Hook Invocations
# ! By design, the directory-based hooks only execute against a given
# ! directory once per hook invocation. HOWEVER, pre-commit can invoke a
# ! hook multiple times if a large number of files are staged
# ! (due to OS command-line length limits).
# ! directory once per hook invocation.
# ! HOWEVER, due to OS command-line length limits, Pre-Commit can invoke
# ! a hook multiple times if a large number of files are staged.
#
# Repo-Based Hooks:
# Hooks named '*-repo-*' only run once (if any matching files are staged).
Expand Down

0 comments on commit 0cacfe3

Please sign in to comment.