News for hackers. Stuff that matters.
Re:A Note About Git Commit Messages by nailer on Friday January 07, 2011 @12:15PM (#2080146)
> wrapping your commit messages to 72 columns

> On an 80 column terminal

> Good email netiquette dictates we wrap our plain text emails (for) an 80 column terminal.

I think format should be separated from presentation and presuming people should use a particular display device is wrong. These are well established principles and Unix, although lacking a tradition of interface design, isn't some kind of exception.

* I use a modern email program (I use gmail but this would include, say, mutt).

* I sometimes use a wider terminal. Sometimes I use a narrower one. On my system (OS X default 10.6) less handles this just fine unless some 72-character-neckbeard screws it up.

* I sometimes use a GUI tool to examine messages, like github. These may be wider or narrower.

In all these cases forced 72 character wrappings look terrible.

Re:A Note About Git Commit Messages by lambda on Friday January 07, 2011 @01:00PM (#2080347)
I agree that ideally, you wouldn't wrap your text manually and your editor would do soft-wrapping, as well as any tools like `git log` or email programs that patches were read with, so the commit message would fit on any size screen.

In the real world, however, lots of people use editors that don't have good soft-wrap support turned on by default, meaning that they're going to be doing hard-wrapping at some width. `git log` does not do any wrapping of messages, so depending on your pager settings you either get the line going off the edge of the screen or being wrapped by your terminal with no regard for word breaks.

Furthermore, even when soft-wrap is supported, it sometimes makes text harder to read; if your window is wide, and it just uses the whole thing displaying 150 characters per line, it can make the text a lot harder to read than a nice narrow column of text. I have this problem on the web a lot; some sites use multiple columns which take up lots of horizontal space (under the assumption that everyone runs their browser full-screen), which makes me widen my window, but then I come across a site that just uses the whole width for one big block of text, which now has unreadably long lines.

Given that many of the tools in question don't support soft-wrapping usably, standardizing on 72-column hard wrapping is a reasonable approach. Lines don't come out unreadably long that way, they will be displayed reasonably in `git log` and other tools on standard-width terminals, and they will display well in 80-column email clients even with several levels of quoting.

Re:A Note About Git Commit Messages by notJim on Friday January 07, 2011 @01:33PM (#2080520)
I totally agree with this. Frankly, I don't think its too much to ask people to use modern software that is capable of very basic functionality like wrapping text. I find 72-column text with arbitrary (in the sense that the line breaks are at character-boundaries, not paragraph boundaries) line breaks incredibly hard to read.

For example:

  I guess it also depends on who your audience is. Most of the devs I've
  worked with use modern software, so long lines have never been an
  issue for me. I could see where some teams would have a culture of 
  using more basic tools that it would become more of an issue. Of 
  course, typography plays a role, too. I don't generally use a 
  monospace font for reading normal text, and proportional fonts seem 
  to work better with this outdated style.
Re:A Note About Git Commit Messages by lukeschlather on Friday January 07, 2011 @04:46PM (#2081253)
Wrapping text really muddles code. Ideally commit messages should have a different interface than your code, but in some cases people are going to be looking at it through a tool that is in more of a code-oriented space.
Re:A Note About Git Commit Messages by steveklabnik on Friday January 07, 2011 @12:18PM (#2080153)
Exactly. That's why you write it to the lowest common denominator, so that everyone can use it well.
Re:A Note About Git Commit Messages by lallysingh on Friday January 07, 2011 @12:54PM (#2080302)
And let's not forget where else where the text may end up later.

I'm sure this message was fine in their mail reader:

http://www.ietf.org/mail-archive/web/manet/current/msg11520.... (chosen only b/c I was reading through the list this morning)

But now I must horizontally scroll :(

Re:A Note About Git Commit Messages by uxp on Friday January 07, 2011 @01:01PM (#2080361)
To be fair, thats a problem with the way browsers render anything inside the <pre> tag. If anything, it is an example of what people should do, not force unnecessary restrictions on the way they write text. Lest you might end up with:

    > This is a short paragraph that I am quoting that 
    > someone
    > else sent to me.
Re:A Note About Git Commit Messages by pjscott on Friday January 07, 2011 @01:10PM (#2080409)
Emacs has spoiled me. As soon as I saw your post, I felt a weird tingling urge to press M-q and fix it.
Re:A Note About Git Commit Messages by lallysingh on Friday January 07, 2011 @01:08PM (#2080395)
Indeed. We can fix all these systems... or stay at 72 columns.
Re:A Note About Git Commit Messages by chc on Friday January 07, 2011 @07:56PM (#2081767)
Or door 3: Let bad software stay bad, use good software instead and format our text naturally. If somebody chooses to use software that can't wrap text, that's fine for them personally — but I shouldn't have to deal with their artificial limitations.
Re:A Note About Git Commit Messages by notJim on Friday January 07, 2011 @01:13PM (#2080424)
Right-click, Inspect Element `white-space: normal`

No more scrolling.

Re:A Note About Git Commit Messages by billmcneale on Friday January 07, 2011 @04:25PM (#2081180)
The problem is with the way the archive web site decided to render this text.

From a web standpoint, the author of this email did the right thing: introduce very little formatting (only paragraph breaks) and leave it up to style sheets to render his text the way the reader wants it.

That's how you get the same text to render perfectly on a twenty column display (e.g. an old phone), a 30' inch monitor and everything in-between.

Introducing manual newlines at arbitrary points (e.g. 80 columns) is a bad practice that assumes that everyone will read your text on the same device.

Relevant explanation:

http://beust.com/weblog/2009/03/10/of-kindle-and-web-usabili...

Re:A Note About Git Commit Messages by notJim on Friday January 07, 2011 @01:18PM (#2080441)
Don't you mean:

  > Exactly. That's why you write it to the lowest common denominator, so
  > that everyone can use it well.
Reads great!
Re:A Note About Git Commit Messages by steveklabnik on Friday January 07, 2011 @01:51PM (#2080604)
I didn't say that all text ever should always be 72 columns in length. A git commit message and a Hacker News comment are used in completely different ways.

Also, I probably would have moved the ', so' to the next line, so that it reads a bit better.

Re:A Note About Git Commit Messages by nailer on Friday January 07, 2011 @12:24PM (#2080172)
Agreed: re: making sure that everyone can use it well, but targeting LCD will break newer devices sometimes. As far as I can tell, using linebreaks for linebreaks will give you readable output on the widest variety of devices.
Re:A Note About Git Commit Messages by jm3 on Friday January 07, 2011 @12:32PM (#2080220)
Some interesting data on how line-length affects readers exists here: http://www.codinghorror.com/blog/2006/06/text-columns-how-lo...
Re:A Note About Git Commit Messages by novel on Sunday January 09, 2011 @12:46AM (#2084926)
What's terrible with 72 char wrapping? 72 char wrapped text looks almost like an average printed book or pdf for example and reads perfectly well.

And people who have really large screens could use vertical splits or maybe tilling window managers to utilise their screen space more effectively.

Re:A Note About Git Commit Messages by random42 on Saturday January 08, 2011 @05:27PM (#2084136)
The log messages are written for the 3rd person, not you. He may not use a modern email program, wider terminal or GUI tools, like you do.

It makes sense to write for the least common denominator.