Commit aaf2b7dc authored by Sebastien Barre's avatar Sebastien Barre Committed by Brad King

commit-msg: Make max length of first line configurable

parent 76566ed3
......@@ -53,6 +53,7 @@ msg_is_revert() {
msg_first() {
len=$(echo -n "$line" | wc -c)
max_len=$(hooks_config --get hooks.commit-msg.maxLength || echo 78) &&
if test $len -eq 0; then
# not yet first line
return
......@@ -61,8 +62,8 @@ msg_first() {
--------
'"$line"'
--------'
elif test $len -gt 78 && ! msg_is_merge && ! msg_is_revert; then
die 'The first line may be at most 78 characters:
elif test $len -gt "$max_len" && ! msg_is_merge && ! msg_is_revert; then
die 'The first line may be at most '"$max_len"' 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