From: Andreas Dilger Date: Wed, 20 Jun 2012 18:59:47 +0000 (-0600) Subject: LU-1595 build: add 70-column commit comment wrap X-Git-Tag: 2.2.91~25 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=beceef1754ef91ccc3a65c25f6f47a5715e9ad1e LU-1595 build: add 70-column commit comment wrap 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 Change-Id: I04f8e0278a18a869b78acbf9dd1b55adf354500c Reviewed-on: http://review.whamcloud.com/3284 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Li Wei Reviewed-by: Bruce Korb Reviewed-by: Oleg Drokin --- diff --git a/build/commit-msg b/build/commit-msg index bb771b5..422117e 100755 --- a/build/commit-msg +++ b/build/commit-msg @@ -27,7 +27,7 @@ init() { 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\} " diff --git a/build/prepare-commit-msg b/build/prepare-commit-msg index ae644eb..cbb486e 100755 --- a/build/prepare-commit-msg +++ b/build/prepare-commit-msg @@ -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 "# vim:textwidth=70:" >> "$1"