FRDM K64F Metronome

Committer:
ram54288
Date:
Sun May 14 18:35:07 2017 +0000
Revision:
0:a2cb7295a1f7
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ram54288 0:a2cb7295a1f7 1 #!/bin/sh
ram54288 0:a2cb7295a1f7 2 #
ram54288 0:a2cb7295a1f7 3 # An example hook script to verify what is about to be committed.
ram54288 0:a2cb7295a1f7 4 # Called by "git commit" with no arguments. The hook should
ram54288 0:a2cb7295a1f7 5 # exit with non-zero status after issuing an appropriate message if
ram54288 0:a2cb7295a1f7 6 # it wants to stop the commit.
ram54288 0:a2cb7295a1f7 7 #
ram54288 0:a2cb7295a1f7 8 # To enable this hook, rename this file to "pre-commit".
ram54288 0:a2cb7295a1f7 9
ram54288 0:a2cb7295a1f7 10 if git rev-parse --verify HEAD >/dev/null 2>&1
ram54288 0:a2cb7295a1f7 11 then
ram54288 0:a2cb7295a1f7 12 against=HEAD
ram54288 0:a2cb7295a1f7 13 else
ram54288 0:a2cb7295a1f7 14 # Initial commit: diff against an empty tree object
ram54288 0:a2cb7295a1f7 15 against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
ram54288 0:a2cb7295a1f7 16 fi
ram54288 0:a2cb7295a1f7 17
ram54288 0:a2cb7295a1f7 18 # If you want to allow non-ascii filenames set this variable to true.
ram54288 0:a2cb7295a1f7 19 allownonascii=$(git config hooks.allownonascii)
ram54288 0:a2cb7295a1f7 20
ram54288 0:a2cb7295a1f7 21 # Redirect output to stderr.
ram54288 0:a2cb7295a1f7 22 exec 1>&2
ram54288 0:a2cb7295a1f7 23
ram54288 0:a2cb7295a1f7 24 # Cross platform projects tend to avoid non-ascii filenames; prevent
ram54288 0:a2cb7295a1f7 25 # them from being added to the repository. We exploit the fact that the
ram54288 0:a2cb7295a1f7 26 # printable range starts at the space character and ends with tilde.
ram54288 0:a2cb7295a1f7 27 if [ "$allownonascii" != "true" ] &&
ram54288 0:a2cb7295a1f7 28 # Note that the use of brackets around a tr range is ok here, (it's
ram54288 0:a2cb7295a1f7 29 # even required, for portability to Solaris 10's /usr/bin/tr), since
ram54288 0:a2cb7295a1f7 30 # the square bracket bytes happen to fall in the designated range.
ram54288 0:a2cb7295a1f7 31 test $(git diff --cached --name-only --diff-filter=A -z $against |
ram54288 0:a2cb7295a1f7 32 LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
ram54288 0:a2cb7295a1f7 33 then
ram54288 0:a2cb7295a1f7 34 echo "Error: Attempt to add a non-ascii file name."
ram54288 0:a2cb7295a1f7 35 echo
ram54288 0:a2cb7295a1f7 36 echo "This can cause problems if you want to work"
ram54288 0:a2cb7295a1f7 37 echo "with people on other platforms."
ram54288 0:a2cb7295a1f7 38 echo
ram54288 0:a2cb7295a1f7 39 echo "To be portable it is advisable to rename the file ..."
ram54288 0:a2cb7295a1f7 40 echo
ram54288 0:a2cb7295a1f7 41 echo "If you know what you are doing you can disable this"
ram54288 0:a2cb7295a1f7 42 echo "check using:"
ram54288 0:a2cb7295a1f7 43 echo
ram54288 0:a2cb7295a1f7 44 echo " git config hooks.allownonascii true"
ram54288 0:a2cb7295a1f7 45 echo
ram54288 0:a2cb7295a1f7 46 exit 1
ram54288 0:a2cb7295a1f7 47 fi
ram54288 0:a2cb7295a1f7 48
ram54288 0:a2cb7295a1f7 49 # If there are whitespace errors, print the offending file names and fail.
ram54288 0:a2cb7295a1f7 50 exec git diff-index --check --cached $against --