Repository: mesos
Updated Branches:
  refs/heads/master af6309f1c -> 18f60da86


Fixed commit message hook to iterate over the lines rather than words.

Review: https://reviews.apache.org/r/45767/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b32a029c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b32a029c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b32a029c

Branch: refs/heads/master
Commit: b32a029c9d890cd5fe05302c54aaff6c8af826bc
Parents: af6309f
Author: Michael Park <mp...@apache.org>
Authored: Wed Apr 6 14:40:45 2016 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Wed Apr 6 14:40:45 2016 -0700

----------------------------------------------------------------------
 support/hooks/commit-msg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b32a029c/support/hooks/commit-msg
----------------------------------------------------------------------
diff --git a/support/hooks/commit-msg b/support/hooks/commit-msg
index d3d5415..ccb8f4d 100755
--- a/support/hooks/commit-msg
+++ b/support/hooks/commit-msg
@@ -15,14 +15,14 @@ FIRST_LINE=$(head -n 1 $1)
 LAST_CHAR=$(echo -n $FIRST_LINE | tail -c 1)
 FIRST_CHAR=$(echo -n $FIRST_LINE | head -c 1)
 
-for LINE in $COMMIT_MESSAGE
+while read LINE
 do
     LENGTH=$(echo $LINE | wc -c)
     if [ "$LENGTH" -gt "73" ]; then
         echo >&2 "Error: No line in the commit message summary may exceed 72 
characters."
         exit 1
     fi
-done
+done <<< "$COMMIT_MESSAGE"
 
 if [[ ! "$FIRST_CHAR" =~ [A-Z] ]]; then
     echo >&2 "Error: Commit message summary (the first line) must start with a 
capital letter."

Reply via email to