Skip to content

Commit 27b6e17

Browse files
RichiHgitster
authored andcommitted
templates: Use heredoc in pre-commit hook
This way, it is easier to see how the text we give the end users would look like, and it will allow us to use (near) full width of the source file. Signed-off-by: Richard Hartmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0da7a53 commit 27b6e17

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

templates/hooks--pre-commit.sample

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ 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
38+
with people on other platforms.
39+
40+
To be portable it is advisable to rename the file.
41+
42+
If you know what you are doing you can disable this
43+
check using:
44+
45+
git config hooks.allownonascii true
46+
EOF
4647
exit 1
4748
fi
4849

0 commit comments

Comments
 (0)