mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
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 6d35cc76 (Document hooks., 2005-09-02). Then 3e14dd2c (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
d00e364d.[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 <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9a2fb147f2
commit
8cbbdc92f7
@ -103,17 +103,14 @@ invoked before obtaining the proposed commit log message and
|
|||||||
making a commit. Exiting with a non-zero status from this script
|
making a commit. Exiting with a non-zero status from this script
|
||||||
causes the `git commit` command to abort before creating a commit.
|
causes the `git commit` command to abort before creating a commit.
|
||||||
|
|
||||||
The default 'pre-commit' hook, when enabled, catches introduction
|
|
||||||
of lines with trailing whitespaces and aborts the commit when
|
|
||||||
such a line is found.
|
|
||||||
|
|
||||||
All the `git commit` hooks are invoked with the environment
|
All the `git commit` hooks are invoked with the environment
|
||||||
variable `GIT_EDITOR=:` if the command will not bring up an editor
|
variable `GIT_EDITOR=:` if the command will not bring up an editor
|
||||||
to modify the commit message.
|
to modify the commit message.
|
||||||
|
|
||||||
The default 'pre-commit' hook, when enabled--and with the
|
The default 'pre-commit' hook, when enabled, prevents the introduction
|
||||||
`hooks.allownonascii` config option unset or set to false--prevents
|
of non-ASCII filenames and lines with trailing whitespace. The non-ASCII
|
||||||
the use of non-ASCII filenames.
|
check can be turned off by setting the `hooks.allownonascii` config
|
||||||
|
option to `true`.
|
||||||
|
|
||||||
pre-merge-commit
|
pre-merge-commit
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user