aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-03-11 19:44:21 +0100
committerIgor Wiedler <igor@wiedler.ch>2010-03-11 19:44:21 +0100
commitf9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8 (patch)
tree778ec80a8dc67fe703ee5f264fc2e8eafff58ff6 /git-tools
parent6df10358aa7f9c544b188b51d6d1e8b3e66c8a28 (diff)
downloadforums-f9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8.tar
forums-f9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8.tar.gz
forums-f9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8.tar.bz2
forums-f9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8.tar.xz
forums-f9192bed79c2d5a0c1e8388bcdc35be3d21aa9a8.zip
[git-tools] Some pre-commit enhancements, abolish tempfile
Diffstat (limited to 'git-tools')
-rwxr-xr-xgit-tools/hooks/pre-commit8
1 files changed, 4 insertions, 4 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 937d2d2dc0..6129470196 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -12,6 +12,8 @@
# ln -s ../../git-tools/hooks/pre-commit \\
# .git/hooks/pre-commit
+PHP_BIN=php
+
# necessary check for initial commit
if git rev-parse --verify HEAD >/dev/null 2>&1
then
@@ -27,12 +29,10 @@ error=0
IFS=" "
for file in $(git diff --cached --name-status $against | grep -v -E '^D' | cut -f2 | grep -E '\.php$')
do
- # store lint result in a temp file
- tempfile=$(mktemp -t "$(basename $0).XXXXXX")
- if ! php -l "$file" >/dev/null 2>"$tempfile"
+ # hide output, but show errors
+ if ! $PHP_BIN -l "$file" >/dev/null
then
error=1
- cat "$tempfile"
fi
done
unset IFS