X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=.git_template%2Fhooks%2Fpre-commit;h=182dcb9af9ea5fcac76786e4bf293c677afbd5ed;hb=cb16d3950c49e44e40c765db5c50fc4f961fee29;hp=ad2218a75005212d19a5da44fe034cc6a788f6ea;hpb=6c41878284a2347515e54a61b5aa650f130b0a81;p=distro-setup diff --git a/.git_template/hooks/pre-commit b/.git_template/hooks/pre-commit index ad2218a..182dcb9 100755 --- a/.git_template/hooks/pre-commit +++ b/.git_template/hooks/pre-commit @@ -14,9 +14,8 @@ # limitations under the License. -# This is the git upstream example hook, but it's actually useful. +# ian: This section is the git upstream example hook, but it's actually useful. -# # An example hook script to verify what is about to be committed. # Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if @@ -58,17 +57,18 @@ EOF exit 1 fi -set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR -# inspired from: +# ian: inspired from: # https://github.com/ntc2/conf/blob/master/dot.gitconfig +# last checked for any changes there on 7/2016 # duplicated at, # http://stackoverflow.com/a/15398512/14456 -# last checked for any changes there on 7/2016 +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR + if [[ $(git config --bool hooks.allowwhitespace) == true ]] || \ [[ $GIT_ALLOWWHITESPACE == true ]]; then exit 0