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 hookmaint
commit
dfb78f0388
|
|
@ -15,13 +15,13 @@ else
|
||||||
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If you want to allow non-ascii filenames set this variable to true.
|
# If you want to allow non-ASCII filenames set this variable to true.
|
||||||
allownonascii=$(git config hooks.allownonascii)
|
allownonascii=$(git config hooks.allownonascii)
|
||||||
|
|
||||||
# Redirect output to stderr.
|
# Redirect output to stderr.
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
|
|
||||||
# Cross platform projects tend to avoid non-ascii filenames; prevent
|
# Cross platform projects tend to avoid non-ASCII filenames; prevent
|
||||||
# them from being added to the repository. We exploit the fact that the
|
# them from being added to the repository. We exploit the fact that the
|
||||||
# printable range starts at the space character and ends with tilde.
|
# printable range starts at the space character and ends with tilde.
|
||||||
if [ "$allownonascii" != "true" ] &&
|
if [ "$allownonascii" != "true" ] &&
|
||||||
|
|
@ -31,18 +31,17 @@ if [ "$allownonascii" != "true" ] &&
|
||||||
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
||||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
||||||
then
|
then
|
||||||
echo "Error: Attempt to add a non-ascii file name."
|
cat <<\EOF
|
||||||
echo
|
Error: Attempt to add a non-ASCII file name.
|
||||||
echo "This can cause problems if you want to work"
|
|
||||||
echo "with people on other platforms."
|
This can cause problems if you want to work with people on other platforms.
|
||||||
echo
|
|
||||||
echo "To be portable it is advisable to rename the file ..."
|
To be portable it is advisable to rename the file.
|
||||||
echo
|
|
||||||
echo "If you know what you are doing you can disable this"
|
If you know what you are doing you can disable this check using:
|
||||||
echo "check using:"
|
|
||||||
echo
|
git config hooks.allownonascii true
|
||||||
echo " git config hooks.allownonascii true"
|
EOF
|
||||||
echo
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue