aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools/hooks/commit-msg
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-09-09 00:23:33 +0200
committerIgor Wiedler <igor@wiedler.ch>2010-09-09 00:23:33 +0200
commit2baa8c61d119707246f87372bb9e8036fcfc99fb (patch)
treecacdb325fbf48e4d2d6875d2642a274f5f2bfb0a /git-tools/hooks/commit-msg
parentea4d204cf68b3cee2bfb0633085e4ebdadeb3a80 (diff)
parent2e891c5eba78d68796dc6854d5805af2e3978641 (diff)
downloadforums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar
forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.gz
forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.bz2
forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.xz
forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [task/git-tools] Change the GNU --lines argument to the POSIX -l [task/git-tools] Solve dependency on the GNU wc --max-line-length option [ticket/8944] Patch db_tools to support index length for MySQL4 [ticket/9039] Make mssqlnative.php non-executable [ticket/8944] Add index length to CREATE INDEX for MySQL4 in database_update [ticket/9800] Update tracker URL in docs/README.html
Diffstat (limited to 'git-tools/hooks/commit-msg')
-rwxr-xr-xgit-tools/hooks/commit-msg9
1 files changed, 5 insertions, 4 deletions
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
index d6ad57a38a..a6777ff9c9 100755
--- a/git-tools/hooks/commit-msg
+++ b/git-tools/hooks/commit-msg
@@ -55,16 +55,17 @@ 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
-lines=$(wc --lines "$1" | cut -f1 -d" ");
+lines=$(wc -l "$1" | awk '{ print $1; }');
expecting=header;
in_description=0;
in_empty=0;