aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools/hooks
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2010-09-07 23:35:47 +0100
committerChris Smith <toonarmy@phpbb.com>2010-09-07 23:35:47 +0100
commit8ce2f63d73f8f3b5fec220448ca060c43733840f (patch)
tree6ce0e6fbf66c1b8783a9ef6ae6daf2f1104b7c51 /git-tools/hooks
parente17ffa01e6f536b0868106405993361f1d978706 (diff)
downloadforums-8ce2f63d73f8f3b5fec220448ca060c43733840f.tar
forums-8ce2f63d73f8f3b5fec220448ca060c43733840f.tar.gz
forums-8ce2f63d73f8f3b5fec220448ca060c43733840f.tar.bz2
forums-8ce2f63d73f8f3b5fec220448ca060c43733840f.tar.xz
forums-8ce2f63d73f8f3b5fec220448ca060c43733840f.zip
[task/git-tools] Solve dependency on the GNU wc --max-line-length option
PHPBB3-9808
Diffstat (limited to 'git-tools/hooks')
-rwxr-xr-xgit-tools/hooks/commit-msg7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
index d6ad57a38a..91951b05c2 100755
--- a/git-tools/hooks/commit-msg
+++ b/git-tools/hooks/commit-msg
@@ -55,11 +55,12 @@ quit()
fi
}
-if [ "$(wc --max-line-length "$1" | cut -f1 -d" ")" -gt 80 ]
+msg=$(grep -nE '.{81,}' "$1");
+
+if [ $? -eq 0 ]
then
echo "The following lines are greater than 80 characters long:\n" >&2;
-
- grep -nE '.{81,}' "$1" >&2;
+ echo $msg >&2;
quit $ERR_LENGTH;
fi