mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
commit-msg: Make max length of first line configurable
This commit is contained in:
parent
76566ed32d
commit
aaf2b7dcf8
@ -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"'
|
||||
------------------------------------------------------------------------------'
|
||||
|
Loading…
Reference in New Issue
Block a user