summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-11-17 17:54:50 -0500
committerBrad King <brad.king@kitware.com>2010-11-17 17:54:50 -0500
commit125100babc6a0c1f25cb88b7da66c1bbb2a62fdf (patch)
treeb0df5d34eb5860b9b1857db8c39791e08964789f
parentdc31be5bda3817384e0208b38a905ab8a070196a (diff)
downloadcmake-125100babc6a0c1f25cb88b7da66c1bbb2a62fdf.tar.gz
commit-msg: Allow long first lines starting in "Revert "
Revert commits always have longer first lines than the commit they revert. Do not reject those that happen to go over the threshold. It is much simpler if the "git revert" command creates the commit without error.
-rwxr-xr-xcommit-msg6
1 files changed, 5 insertions, 1 deletions
diff --git a/commit-msg b/commit-msg
index 7856f1ef57..5d18c5ae37 100755
--- a/commit-msg
+++ b/commit-msg
@@ -41,6 +41,10 @@ msg_is_merge() {
echo "$line" | grep "^Merge " >/dev/null 2>&1
}
+msg_is_revert() {
+ echo "$line" | grep "^Revert " >/dev/null 2>&1
+}
+
msg_first() {
len=$(echo -n "$line" | wc -c)
if test $len -eq 0; then
@@ -51,7 +55,7 @@ msg_first() {
--------
'"$line"'
--------'
- elif test $len -gt 78 && ! msg_is_merge; then
+ elif test $len -gt 78 && ! msg_is_merge && ! msg_is_revert; then
die 'The first line may be at most 78 characters:
------------------------------------------------------------------------------
'"$line"'