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 <richih.mailinglist@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Richard Hartmann committed Jul 14, 2013 at 18:21 UTC 27b6e17a6d84a18861f05fd7c684ab443bf15244
1 file changed +13 -12
templates/hooks--pre-commit.sample
+13 -12
@@ -31,18 +31,19 @@ if [ "$allownonascii" != "true" ] &&
31 test $(git diff --cached --name-only --diff-filter=A -z $against |
32 LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
33 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
47 exit 1
48 fi
49