New issue
Advanced search Search tips

Issue 919960 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Gerrit should help limit CL description width when editing description.

Project Member Reported by salg@google.com, Jan 8

Issue description


What 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
 
Cc: ajp@chromium.org
Labels: -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)
This seems like a useful feature but it would need to be configurable or Chromium specific, probably implemented as a plugin, since not all teams using Gerrit have the same guidelines.

For Chromium... As far as I can tell, the 72 characters is a suggestion not a limit. I'm new to Chrome, but these committing guidelines don't mention it: https://www.chromium.org/developers/contributing-code#TOC-Writing-commit-descriptions. If it is a hard limit I would love a pointer to the documentation saying so for my own learning!
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.
Cc: aga...@chromium.org
+agable
Cc: -aga...@chromium.org
Components: -Infra>Codereview>Gerrit Infra>Git>Admin
Changing to Infra>Git>Admin, per agable
Status: Untriaged (was: Available)
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