Skip to content
Snippets Groups Projects
Commit aaf2b7dc authored by Sebastien Barre's avatar Sebastien Barre Committed by Brad King
Browse files

commit-msg: Make max length of first line configurable

parent 76566ed3
No related branches found
No related tags found
No related merge requests found
......@@ -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"'
------------------------------------------------------------------------------'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment