Commit 34c97a311c6463bb171a46eaf4a5357aed41964d
1 parent
9711acc9
Exists in
master
and in
4 other branches
Increase commit title limit at Commit#show so it does not truncate most of Merge messages
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
app/models/commit.rb
| ... | ... | @@ -36,16 +36,16 @@ class Commit |
| 36 | 36 | # Returns the commits title. |
| 37 | 37 | # |
| 38 | 38 | # Usually, the commit title is the first line of the commit message. |
| 39 | - # In case this first line is longer than 80 characters, it is cut off | |
| 40 | - # after 70 characters and ellipses (`&hellp;`) are appended. | |
| 39 | + # In case this first line is longer than 100 characters, it is cut off | |
| 40 | + # after 80 characters and ellipses (`&hellp;`) are appended. | |
| 41 | 41 | def title |
| 42 | 42 | title = safe_message |
| 43 | 43 | |
| 44 | 44 | return no_commit_message if title.blank? |
| 45 | 45 | |
| 46 | 46 | title_end = title.index(/\n/) |
| 47 | - if (!title_end && title.length > 80) || (title_end && title_end > 80) | |
| 48 | - title[0..69] << "…".html_safe | |
| 47 | + if (!title_end && title.length > 100) || (title_end && title_end > 100) | |
| 48 | + title[0..79] << "…".html_safe | |
| 49 | 49 | else |
| 50 | 50 | title.split(/\n/, 2).first |
| 51 | 51 | end |
| ... | ... | @@ -58,8 +58,8 @@ class Commit |
| 58 | 58 | description = safe_message |
| 59 | 59 | |
| 60 | 60 | title_end = description.index(/\n/) |
| 61 | - if (!title_end && description.length > 80) || (title_end && title_end > 80) | |
| 62 | - "…".html_safe << description[70..-1] | |
| 61 | + if (!title_end && description.length > 100) || (title_end && title_end > 100) | |
| 62 | + "…".html_safe << description[80..-1] | |
| 63 | 63 | else |
| 64 | 64 | description.split(/\n/, 2)[1].try(:chomp) |
| 65 | 65 | end | ... | ... |