Line length and word wrapping in commit messages

158 views
Skip to first unread message

Olivier Croquette

unread,
Sep 9, 2021, 5:15:24 AM9/9/21
to Repo and Gerrit Discussion
Hello,

we updated recently from Gerrit 3.1 to 3.4 and realized that the new version is a bit more opinionated about the maximum length of the lines in the commit message.
For internal reasons, we use lines of up to 80 characters, even 100 for the headline, and we have the following issues with the new version:
- word wrap is performed in the commit message on the page of the code review, making it difficult to read it
- a blue line is displayed in the "diff" view of the commit message at a position which is meaningless to us.

Both are pure UI issues, but the first issue is the most problematic. Is there a way to increase the width of the area where the commit message is displayed, to avoid word wrapping at inappropriate locations? Screen real estate is not an issue, since the area at the right of the commit message area is unused.

I tried to change the settings documented here:

But it did not seem to help. The documentation is not clear about the effect of the settings, for instance if they are used to adapt the UI, or only for validation.

Thanks,
Olivier

Sven Selberg

unread,
Sep 9, 2021, 6:45:20 AM9/9/21
to Repo and Gerrit Discussion
On Thursday, September 9, 2021 at 11:15:24 AM UTC+2 Olivier Croquette wrote:
Hello,

we updated recently from Gerrit 3.1 to 3.4 and realized that the new version is a bit more opinionated about the maximum length of the lines in the commit message.
For internal reasons, we use lines of up to 80 characters, even 100 for the headline, and we have the following issues with the new version:
- word wrap is performed in the commit message on the page of the code review, making it difficult to read it
- a blue line is displayed in the "diff" view of the commit message at a position which is meaningless to us.

Not to invalidate your request for support for arbitrary commit-message line-lengths but to give explanation and historical background to this line.
It's set at 72 chars, which is the "default" max line-length in a commit message for historical reasons since if you issue a "git log" in a terminal the commit message is indented by 4 spaces:

commit c7b7743b1d70504df2a59f76565895f2f45bf150
Date:   Fri Sep 3 17:05:24 2021 +0200

    Convert gr-api-utils_test to typescript
    
    Only imports and formatting needed adjusting
    
    Change-Id: Id0dc684681049cfcda9ddaa9a9b3eb018294fcd0

If the commit-message lines are a maxium 72 chars this fits nicely in an 80 char terminal with a 4 char border on each side.

Olivier Croquette

unread,
Sep 9, 2021, 1:39:33 PM9/9/21
to Repo and Gerrit Discussion
On Thursday, September 9, 2021 at 12:45:20 PM UTC+2 Sven Selberg wrote:
Not to invalidate your request for support for arbitrary commit-message line-lengths but to give explanation and historical background to this line.
It's set at 72 chars, which is the "default" max line-length in a commit message for historical reasons since if you issue a "git log" in a terminal the commit message is indented by 4 spaces:

Hi Sven,

thanks for the info. Do you know where this limit is set, and if there is way to change it?

Olivier

Sven Selberg

unread,
Sep 9, 2021, 2:33:24 PM9/9/21
to Repo and Gerrit Discussion
Hi Sven,

thanks for the info. Do you know where this limit is set, and if there is way to change it?'

https://gerrit.googlesource.com/gerrit/+/refs/heads/master/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.ts#105

It doesn't look like it's configurable, so only if you edit gr-diff.ts and recompile.
 

Olivier

Jonathan Nieder

unread,
Sep 9, 2021, 4:31:00 PM9/9/21
to Sven Selberg, Repo and Gerrit Discussion
> It doesn't look like it's configurable, so only if you edit gr-diff.ts and recompile.

That said, a crbug.com/gerrit/ to make it configurable seems reasonable enough as an idea. I think https://crbug.com/gerrit/7217 is the place to look if you'd like to work on that.

Thanks,
Jonathan

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/c3b07713-56bc-46a9-b95c-c25994ca8284n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages