Hard-wrapping paragraphs to a desired length in the original log allows humans to decide which lines should wrap and which ones shouldn't, without a pile of complexity similar to HTML, Markdown, or some other markup language.
soft-wrap:
- to allow the presentation layer to soft-wrap a line, just don't add a newline.
- for new paragraphs, just add two newlines as usual
- for indent sensitive code, diagrams, etc. add newlines where appropriate, taking care to not exceed 74 columns for any line. Everyone does this already.
+ tweak:
- in the presentation layer, soft-wrap all lines except those less than 74 characters long.
This isn't perfect for terminals less than 80 characters wide, in that the diagrams won't fit, but nobody uses narrow terminals, and Linus' scheme is even more broken for this case, so it's strictly better. It also allows one to easily distinguish diagrams from non diagrams by eyeballing the text flow. Best of all, it makes fewer assumptions about terminal width.
And what's stopping someone implementing this?
Most likely, not wanting to inflict such a syntax on git users, when the current approach works just fine.
But nothing stops someone from writing a patch with an off-by-default option for such a syntax, and proposing it for inclusion.
The optimal human-readable line length is something like 66 characters. It's much easier to quickly scan a log message that's 72 characters wide vs. one that is 200 characters wide.
"The optimal human-readable line length" isn't really something that exists, even if we make lots of assumptions about basic stuff like font size, avg word length, and color contrast.
Here's a quick study on the reading speed and comprehension of character line lengths (cl) between 35 and 95 for reference: http://psychology.wichita.edu/surl/usabilitynews/72/LineLeng...
- most efficient reading (speed/accuracy) at 95cl
- line length does not affect comprehension
But here's the head spinner:
- 60% _preferred_ either 35cl or 95cl
- 100% _least preferred_ 35cl (45%) or 95cl (55%)
Line length is an easy thing to assume everyone perceives the same way, but even given a consistent environment (definitely not a given in this age of increasingly diverse device dimensions) there's a wide range of preferences with little real impact on readability. Unless, of course, your assumptions about readability clash with the user's preferences or reading environment.
Put simply - make your life easy and reduce problems by just letting the user decide.
This shell script wraps wide commit messages to the width of your console.
GIT_PAGER="fold -s -w`stty size | awk '{print $2}'` | less" git log $@So, wrap your paragraphs in plain-text email at some sensible column. Common convention suggests 72, because that allows for a few rounds of quoting before it passes 80.
set editor="vim -c 'set tw=75 ft=mail noautoindent'"
The 'set tw=75' bit, sets the text width to 75 columns.
please do proper word-wrap and keep columns shorter than about 74 characters or so
How come word-wrapping is left as a task for humans here? Is there a technical/stylistic/cultural reason why lines can't be wrapped automatically to any desired width by the log presentation layer?