Skip to content

Commit dfb78f0

Browse files
committed
Merge branch 'rh/template-updates'
* rh/template-updates: templates: spell ASCII in uppercase in pre-commit hook templates: Reformat pre-commit hook's message templates: Use heredoc in pre-commit hook
2 parents 29143fc + 7b3742f commit dfb78f0

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

templates/hooks--pre-commit.sample

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ else
1515
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
1616
fi
1717

18-
# If you want to allow non-ascii filenames set this variable to true.
18+
# If you want to allow non-ASCII filenames set this variable to true.
1919
allownonascii=$(git config hooks.allownonascii)
2020

2121
# Redirect output to stderr.
2222
exec 1>&2
2323

24-
# Cross platform projects tend to avoid non-ascii filenames; prevent
24+
# Cross platform projects tend to avoid non-ASCII filenames; prevent
2525
# them from being added to the repository. We exploit the fact that the
2626
# printable range starts at the space character and ends with tilde.
2727
if [ "$allownonascii" != "true" ] &&
@@ -31,18 +31,17 @@ if [ "$allownonascii" != "true" ] &&
3131
test $(git diff --cached --name-only --diff-filter=A -z $against |
3232
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
3333
then
34-
echo "Error: Attempt to add a non-ascii file name."
35-
echo
36-
echo "This can cause problems if you want to work"
37-
echo "with people on other platforms."
38-
echo
39-
echo "To be portable it is advisable to rename the file ..."
40-
echo
41-
echo "If you know what you are doing you can disable this"
42-
echo "check using:"
43-
echo
44-
echo " git config hooks.allownonascii true"
45-
echo
34+
cat <<\EOF
35+
Error: Attempt to add a non-ASCII file name.
36+
37+
This can cause problems if you want to work with people on other platforms.
38+
39+
To be portable it is advisable to rename the file.
40+
41+
If you know what you are doing you can disable this check using:
42+
43+
git config hooks.allownonascii true
44+
EOF
4645
exit 1
4746
fi
4847

0 commit comments

Comments
 (0)