Commit f83a32fe authored by Brad King's avatar Brad King

commit-msg: Allow long merge commit subject lines

Merge commits can have long subject lines because they name other
branches.  Accept such messages as a special case for merge commits.
parent 8edae204
......@@ -36,6 +36,11 @@ To continue editing, run the command
#-----------------------------------------------------------------------------
# Check the commit message layout with a simple state machine.
msg_is_merge() {
test -f "$GIT_DIR/MERGE_HEAD" &&
echo "$line" | grep "^Merge " >/dev/null 2>&1
}
msg_first() {
len=$(echo -n "$line" | wc -c)
if test $len -eq 0; then
......@@ -46,7 +51,7 @@ msg_first() {
--------
'"$line"'
--------'
elif test $len -gt 78; then
elif test $len -gt 78 && ! msg_is_merge; 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