Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Commit 8cbbdc9

Browse files
LemmingAvalanchegitster
authored andcommitted
doc: join default pre-commit paragraphs
Join two paragraphs that start with the standard “The default <hook>, when enabled” into one and put it at the end of the “pre-commit” section. The trailing whitespace paragraph was added in the first commit for the doc, in 6d35cc7 (Document hooks., 2005-09-02). Then 3e14dd2 (mention use of "hooks.allownonascii" in "man githooks", 2019-02-20) updated the “pre-commit” section to mention the non-ASCII check that was added in d00e364.[1] But this paragraph was added one-past the original “default” paragraph, after the env. variable paragraph, and starts exactly the same. That causes the flow of this section to feel off (paragraphs in order): 1. Invoked by <cmd> and what parameters it takes 2. The default 'pre-commit' hook catches introduction of trailing whitespace 3. `GIT_EDITOR=:` 4. The default pre-commit' hook catches introduction of non-ASCII filenames Let’s instead join these two paragrahs and explain the whole behavior of the default script. † 1: Extend sample pre-commit hook to check for non ascii filenames, 2009-05-19 Signed-off-by: Kristoffer Haugsbakk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a2fb14 commit 8cbbdc9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Documentation/githooks.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,14 @@ invoked before obtaining the proposed commit log message and
103103
making a commit. Exiting with a non-zero status from this script
104104
causes the `git commit` command to abort before creating a commit.
105105
106-
The default 'pre-commit' hook, when enabled, catches introduction
107-
of lines with trailing whitespaces and aborts the commit when
108-
such a line is found.
109-
110106
All the `git commit` hooks are invoked with the environment
111107
variable `GIT_EDITOR=:` if the command will not bring up an editor
112108
to modify the commit message.
113109
114-
The default 'pre-commit' hook, when enabled--and with the
115-
`hooks.allownonascii` config option unset or set to false--prevents
116-
the use of non-ASCII filenames.
110+
The default 'pre-commit' hook, when enabled, prevents the introduction
111+
of non-ASCII filenames and lines with trailing whitespace. The non-ASCII
112+
check can be turned off by setting the `hooks.allownonascii` config
113+
option to `true`.
117114
118115
pre-merge-commit
119116
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)