Whamcloud - gitweb
LU-1595 build: add 70-column commit comment wrap
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 20 Jun 2012 18:59:47 +0000 (12:59 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 Jul 2012 23:48:34 +0000 (19:48 -0400)
Add a Vim modeline "textwidth=70" to force commit comments to wrap
at 70 characters, to match standard Git commit style guidelines.

Reduce the commit summary length to 62 characters, which is the
maximum that can fit after "Subject: [PATCH] " when formatting a
patch for email.  This is still above the recommended 50 character
summary limit, but with the leading ticket number and component,
there wouldn't be very much room left for a meaningful comment.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I04f8e0278a18a869b78acbf9dd1b55adf354500c
Reviewed-on: http://review.whamcloud.com/3284
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Reviewed-by: Bruce Korb <bruce_korb@xyratex.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
build/commit-msg
build/prepare-commit-msg

index bb771b5..422117e 100755 (executable)
@@ -27,7 +27,7 @@ init() {
                         Reviewed-by \
                         CC \
                 | tr ' ' '|')
                         Reviewed-by \
                         CC \
                 | tr ' ' '|')
-        readonly WIDTH_SUM=64
+        readonly WIDTH_SUM=62
         readonly WIDTH_REG=70
         readonly JIRA_FMT_A="^[A-Z]\{2,5\}-[0-9]\{1,5\} [-a-z0-9]\{2,9\}: "
         readonly JIRA_FMT_B="^[A-Z]\{2,5\}-[0-9]\{1,5\} "
         readonly WIDTH_REG=70
         readonly JIRA_FMT_A="^[A-Z]\{2,5\}-[0-9]\{1,5\} [-a-z0-9]\{2,9\}: "
         readonly JIRA_FMT_B="^[A-Z]\{2,5\}-[0-9]\{1,5\} "
index ae644eb..cbb486e 100755 (executable)
@@ -31,3 +31,4 @@ grep -qs "^$SIGNOFF" "$1" || echo "# $SIGNOFF" >> "$1"
 echo "" >> "$1"
 echo "#" >> "$1"
 git diff --cached | $CHECKPATCH $CHECKPATCH_OPTS - | sed -e 's/^/# /' >> "$1"
 echo "" >> "$1"
 echo "#" >> "$1"
 git diff --cached | $CHECKPATCH $CHECKPATCH_OPTS - | sed -e 's/^/# /' >> "$1"
+echo "# vim:textwidth=70:" >> "$1"