Issue 1950: Commit message editor should wrap and trim the message
Status:  New
Owner: ----
Reported by phil.hord, Jun 7, 2013
Affected Version: 2.6-rc3

What steps will reproduce the problem?
1. Edit a commit message using the commit message edit dialog
2. Type some text long enough to wrap several lines in the dialog window
3. Manually wrap some lines (<END><RETURN>) and do not wrap others
4. Save the message

What is the expected output? 

I expect the message lines to have hard LFs inserted so the commit message is normal-formatted (72 chars).  I expect spaces to be trimmed from the end of lines.

What do you see instead?

Spaces are not trimmed and show up as whitespace errors in Gerrit.
Lines are not wrapped as shown in the dialog window.

Please provide any additional information below.

Jun 7, 2013
#1 phil.hord
I'll grant this assumes the project wants "proper" commit messages.  But non-wrapped messages also screw with Gerrit, causing it to create a possibly very-wide commit message box reaching off the right side of my screen.  

The biggest danger is probably that previously not-wrapped messages would become wrapped (maybe in odd locations) after a simple edit.  Maybe these should be configurable settings. 

Maybe it should be handled by the commit-message-length-validator plugin.
Jun 7, 2013
#2 phil.hord
There's an html-way to wrap messages for HTML5.
<textarea rows="20" cols="72" wrap="hard">

But maybe this is something that should be handled in the rest-api instead.