Gerrit should help limit CL description width when editing description. |
||||
Issue descriptionWhat steps will reproduce the problem? (1) Edit a CL's description on Gerrit (2) The textarea is not bounded to a number of columns, and the description is not wrapped on submit (3) User can save a description with an exceeding number of columns What is the expected result? Either: a) A reminder of the column count limit (like on git cl description) b) Throw an error when the description exceeds the limit b) Automatic text wrapping (like git cl format does on code comments) What happens instead? User is not reminded or warned of the column limit on the description, and is able to submit a description with an exceeding column count
,
Jan 10
It might look a little bit hidden, but they've in fact put the line length limit within the commit message itself: "Long lines should be wrapped to 80 columns for easier log message viewing in terminals." :-) I might be totally off here, but from this bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=841 it seems like the following fields are available as configuration in gerrit already: ### commitmessage.maxSubjectLength : Maximum length of the commit message's subject line. Defaults to 65 if not specified or less than 0. commitmessage.maxLineLength : Maximum length of a line in the commit message's body. Defaults to 70 if not specified or less than 0. commitmessage.longLinesThreshold : Percentage of commit message lines allowed to exceed the maximum length before a warning or error is generated. Defaults to 33 if not specified or less than 0. commitmessage.rejectTooLong : If set to `true`, reject commits whose subject or line length exceeds the maximum allowed length. If not specified, defaults to `false`. ### I'm not sure what the value of those are for Chromium though, but maybe those could be used as input for the formatting suggestion? Maybe there could just be a notification in the UI somewhere that would tell the user it's too long, and then be able to click "Fix" to autoformat. For lines that really need to be very long (long paths, etc.,) I guess they shouldn't be formatted automatically, and if they are, the user should be allowed to edit after the quick fix was applied.
,
Jan 10
+agable
,
Jan 10
Changing to Infra>Git>Admin, per agable
,
Jan 11
Nice. Thank you for the pointers. A git admin can certainly change our repo configuration. The plugin seems to be backend only, but hopefully the Gerrit front end respects the responses! |
||||
►
Sign in to add a comment |
||||
Comment 1 by ajp@chromium.org
, Jan 10Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
Summary: Gerrit should help limit CL description width when editing description. (was: Gerrit not enforcing CL description width limit)