News for hackers. Stuff that matters.
Re:Commit messages guide by dcbadacd on Friday April 19, 2019 @11:32PM (#19704676)
I heavily dislike the hard wrap requirement. Why do that if our clients could do it nicely, based on screen size, preference and everything?
Re:Commit messages guide by Reelin on Saturday April 20, 2019 @01:56AM (#19705020)
Because very often the client will be some piece of command line tooling that doesn't do those things.

https://commit.style

> Git is strongly opinionated that the author is responsible for line breaks; if you omit them, command line tooling will show it as one extremely long unwrapped line.

Re:Commit messages guide by int_19h on Saturday April 20, 2019 @10:24PM (#19710211)
The terminal will still wrap that long line.

In general, this approach is broken by design, because the author cannot know where the commit message is going to be displayed. It might actually be in the context where wrapping at 80 or even at 72 is still not long enough (a tooltip in an IDE, say). Or it might be one where it results in a lot of wasted whitespace. It's much better to fix anything that does not handle wrapping properly to do so, than to impose an arbitrary limit that only really works for one environment.

Re:Commit messages guide by andreareina on Saturday April 20, 2019 @12:43AM (#19704844)
Maximum flexibility with minimum complexity. You want lines that wrap because humans are going to read the message. But you need to be able to not wrap when needed, e.g. when posting code snippets. You need something that any client (including email clients written 10 years before git was a thing) is going to recognize and know how to display correctly. Hard-wrapped plain text fits the bill.
Re:Commit messages guide by cjonas on Saturday April 20, 2019 @01:33AM (#19704964)
Why would you need to support a commit message in a 10 year old client? This is like saying you need to support IE8 in a web app. If the person doesn't like things being broken, then maybe they should update there software...
Re:Commit messages guide by intertextuality on Saturday April 20, 2019 @06:20AM (#19705722)
> 10 year old client

Or simply using a terminal with multiple windows open. I hard wrap at 50 chars and I haven't died from exertion yet.

Re:Commit messages guide by buster on Saturday April 20, 2019 @01:47AM (#19704993)
The ability to display commit messages nicely probably is not the metric by which people chose their email client. Wrapping text where it makes sense is also a task which is best done by the human writing it. I'd rather have a meaningful text flow with sense than some machine hard wrapping in the mi dle of the sentence.
Re:Commit messages guide by u801e on Saturday April 20, 2019 @11:00AM (#19706854)
> Why do that if our clients could do it nicely, based on screen size, preference and everything?

Because there are some thing that shouldn't be soft-wrapped. Like code snippets, diffs, formatted output, etc. It's far easier to let the person who write the commit message to decide where to wrap it rather than relying on the recipient's display to do it for them. Linus Torvalds describes the same issue here [1].

[1] https://github.com/torvalds/linux/pull/17#issuecomment-56606....

Re:Commit messages guide by dcbadacd on Monday April 22, 2019 @10:15AM (#19719082)
Let's do markdown in commit messages then. I despise hard wraps everywhere I see them, they work so bad.