Commit 125100ba authored by Brad King's avatar Brad King

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.
parent dc31be5b
......@@ -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"'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment