Please wrap change descriptions at 80 columns or so

157 views
Skip to first unread message

Nico Weber

unread,
Apr 8, 2013, 11:42:36 AM4/8/13
to blink-dev
Hi,

webkit-patch used to auto-wrap CL descriptions. That doesn't happen with `git cl upload` or if you edit the CL description on rietveld.

`git log` doesn't rewrap commit messages. Please keep `git log` usable by not making your CL description lines too long. Thanks :-)

Nico

Dana Jansens

unread,
Apr 8, 2013, 12:26:15 PM4/8/13
to Nico Weber, blink-dev
See also the chromium-dev thread "Git-friendly CL Descriptions" for more details on perfect CL messages: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/Git-friendly$20CL$20Descriptions/chromium-dev/sRRWJwvy2C8/qIWO7trwI6QJ

Marc-Antoine Ruel

unread,
Apr 8, 2013, 12:28:10 PM4/8/13
to Nico Weber, blink-dev
As a vim user, I usually do something that looks like:
i
<edit the text>
<ESC>
ggVGgqZZ

This is assuming you have in your ~/.vimrc:
set tw=80

Having git-cl automatically word wrap could be potentially annoying. :/ I'm not sure yet what's the best thing to do here. I'll appreciate either comments or patches.

M-A


2013/4/8 Nico Weber <tha...@chromium.org>

Torne (Richard Coles)

unread,
Apr 8, 2013, 12:29:27 PM4/8/13
to Marc-Antoine Ruel, Nico Weber, blink-dev
Yeah, ideally you want 72 columns not 80, as git log indents the commit message for display by default, which means 80 is too wide :)
--
Torne (Richard Coles)
to...@google.com

Marc-Antoine Ruel

unread,
Apr 8, 2013, 12:36:25 PM4/8/13
to Torne (Richard Coles), Nico Weber, blink-dev
Maybe I should change git_cl.py to fire up vim -c "set tw=72" <commit desc file> by default?

:P

But 72 cols is really a linux kernel historical rule. I don't think it's valuable to even try to enforce something this narrow here.

M-A


2013/4/8 Torne (Richard Coles) <to...@google.com>

Torne (Richard Coles)

unread,
Apr 8, 2013, 12:41:00 PM4/8/13
to Marc-Antoine Ruel, Nico Weber, blink-dev
Sure, but the default git log output still indents by four spaces, so if we care about wrapping *anywhere*, we should wrap at no more than 76 :)

Dana Jansens

unread,
Apr 8, 2013, 12:47:38 PM4/8/13
to Torne (Richard Coles), Marc-Antoine Ruel, Nico Weber, blink-dev
On Mon, Apr 8, 2013 at 9:41 AM, Torne (Richard Coles) <to...@google.com> wrote:
Sure, but the default git log output still indents by four spaces, so if we care about wrapping *anywhere*, we should wrap at no more than 76 :)

72 keeps reverts from going over 80 col, since they are indented further.

Daniel Bratell

unread,
Apr 8, 2013, 12:59:26 PM4/8/13
to blink-dev
Den 2013-04-08 18:47:38 skrev Dana Jansens <dan...@chromium.org>:

> On Mon, Apr 8, 2013 at 9:41 AM, Torne (Richard Coles)
> <to...@google.com>wrote:
>
>> Sure, but the default git log output still indents by four spaces, so if
>> we care about wrapping *anywhere*, we should wrap at no more than 76 :)
>>
>
> 72 keeps reverts from going over 80 col, since they are indented further.

If Blink is going to use git, it seems best to use the git conventions for
commit messages. Those are:

----------
Summary line with a max length of about 50 characters

Then an empty line followed by a longer description with a max length
of about 72 character. The 50 character limit is because that line is
often combined with dates, author names and other supplementary data
in logs or other tools. The 72 character length is, as others have said,
to allow a limited indentation without getting too long.

You can also read here or at several other similar places:
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
----------

/Daniel

Nico Weber

unread,
Apr 8, 2013, 1:09:04 PM4/8/13
to Daniel Bratell, blink-dev
On Mon, Apr 8, 2013 at 9:59 AM, Daniel Bratell <bra...@opera.com> wrote:
Den 2013-04-08 18:47:38 skrev Dana Jansens <dan...@chromium.org>:


On Mon, Apr 8, 2013 at 9:41 AM, Torne (Richard Coles) <to...@google.com>wrote:

Sure, but the default git log output still indents by four spaces, so if
we care about wrapping *anywhere*, we should wrap at no more than 76 :)


72 keeps reverts from going over 80 col, since they are indented further.

If Blink is going to use git, it seems best to use the git conventions for commit messages.

The last few times we had threads on this, fights about column counts ensued which is why I didn't mention an exact count :-) If people are aware that they need to manually wrap their CL descriptions and not make the lines "too long", that's probably good enough.

Nico

Peter Kasting

unread,
Apr 8, 2013, 3:30:45 PM4/8/13
to Nico Weber, Daniel Bratell, blink-dev
On Mon, Apr 8, 2013 at 10:09 AM, Nico Weber <tha...@chromium.org> wrote:
The last few times we had threads on this, fights about column counts ensued which is why I didn't mention an exact count :-) If people are aware that they need to manually wrap their CL descriptions and not make the lines "too long", that's probably good enough.

I'm more sympathetic to these concerns than I used to be, but I still think telling people to do this manually is to some degree going to be frustrating.  It would be nice if our tooling either enforced or at least informed about these restrictions.

PK 

Brett Wilson

unread,
Apr 8, 2013, 3:46:45 PM4/8/13
to Peter Kasting, Nico Weber, Daniel Bratell, blink-dev
I'm opposed to telling people to wrap CL descriptions to 80 cols. And
even if we did, I, along with many others, aren't going to remember so
it seems pointless trying.

Brett

Eric Seidel

unread,
Aug 23, 2013, 8:11:42 PM8/23/13
to blin...@chromium.org, Peter Kasting, Nico Weber, Daniel Bratell
It seems we could just fix the tool instead of trying to fix the people? :)

Rietveld is a smart little piece of python, I'm sure it could learn to wrap CL descriptions if necessary. (Or Git when displaying them?)

Dana Jansens

unread,
Aug 23, 2013, 8:13:50 PM8/23/13
to Eric Seidel, blink-dev, Peter Kasting, Nico Weber, Daniel Bratell
On Fri, Aug 23, 2013 at 8:11 PM, Eric Seidel <ese...@chromium.org> wrote:
It seems we could just fix the tool instead of trying to fix the people? :)

Rietveld is a smart little piece of python, I'm sure it could learn to wrap CL descriptions if necessary. (Or Git when displaying them?)

Git descriptions are intentionally allowed to go beyond 80 cols in case you need to include text that would become less clear if it was wrapped.

But providing strong hints is really helpful. I really like the "This is 72 columns" comment in the default file opened when editing your upload message. It's too bad rietveld doesn't have some similar UI (and use a fixed-width font).

Marc-Antoine Ruel

unread,
Aug 24, 2013, 6:11:05 AM8/24/13
to Dana Jansens, Eric Seidel, blink-dev, Peter Kasting, Nico Weber, Daniel Bratell
Only if someone on the team knew js/css enough to draw a yellow line at 72 cols and a read line at 80 cols in the description textbox on Rietveld...

[I don't, shame on me]

M-A


2013/8/23 Dana Jansens <dan...@chromium.org>

Julie Parent

unread,
Aug 24, 2013, 1:23:38 PM8/24/13
to Marc-Antoine Ruel, Dana Jansens, Eric Seidel, blink-dev, Peter Kasting, Nico Weber, Daniel Bratell
I have a change to Rietveld to add the commit message as a special file you review during normal code review process.  It will display at whatever column width you have set (usually 80 chars), so it will be obvious when it is over 80 chars, and your reviewer can even comment on it!  I hope to finish this change this week.


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

PhistucK

unread,
Aug 24, 2013, 4:01:19 PM8/24/13
to Julie Parent, Marc-Antoine Ruel, Dana Jansens, Eric Seidel, blink-dev, Peter Kasting, Nico Weber, Daniel Bratell
This is great!


PhistucK

Rouslan Solomakhin

unread,
Aug 26, 2013, 1:21:58 PM8/26/13
to PhistucK, Julie Parent, Marc-Antoine Ruel, Dana Jansens, Eric Seidel, blink-dev, Peter Kasting, Nico Weber, Daniel Bratell
You can also run "git cl description" to open the CL description in your favorite editor. If it's vim, then "gq" command in normal mode does a pretty good job of wrapping text.
Reply all
Reply to author
Forward
0 new messages