diff --git a/hooks/pre-commit b/hooks/pre-commit index d3ad0cc0c..0d35ef1b5 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -43,8 +43,14 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do fi d=$(clang-format "$f" | diff -u "$f" -) if ! [ -z "$d" ]; then - echo "!!! $f not compliant to coding style, here is the fix:" - echo "$d" + if [ ${#d} -le 30 ]; then + echo "!!! $f not compliant to coding style, here is the fix:" + echo "$d" + else + TEMP=$(mktemp) + echo "$d" > ${TEMP} + echo "!!! $f not compliant to coding style, here is the fix: ${TEMP} please open it in your diff viewer" + fi fail=1 fi done