-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The plugin appears to check only the first line, up to the first \n
in the commit message, when checking the line length of the summary line. But Gerrit (dashboard), Git (git log --format=%s
), Github, and many other tools will join multiple lines together until it encounters a blank line separating them, similar to how Markdown works.
The result is that a commit message summary may pass the length validation check, but when it will be displayed in a list of commits the combined length may exceed the configured length.
Consider a message like:
BUG-123 Fixing something with the bug
BUG-124 and another thing which also has a long description
Description of the two fixes that were included in this commit.
The plugin is only checking the length of BUG-123 Fixing something with the bug
. But when it is displayed in git log --oneline
, or in the Gerrit dashboard or a search results list, it appears as: BUG-123 Fixing something with the bug BUG-124 and another thing which also has a long description
Suggestions to resolve:
- An option to enforce a one-line summary only: The entire commit message must be only 1 line total, or there must be a blank line between lines 1 and 3. If the 2nd line is non-empty text, reject the commit for having a multi-line subject.
- Use the same text reflow methodology that would be used in the Gerrit list view before checking the new combined length.