You are currently looking at an older section of the wincent.dev website.
Please check the new version of the site at https://wincent.dev/ for updated content.

wincent Wincent Colaiuta's weblog

« Add example invocation to documentation (snippets, ed5284b) | Main | Add RDoc documentation to post-receive script (snippets, 238877e) »

July 19, 2007

Soft-wrapping of commit message bodies (snippets, 7be8da9)

Perform some preprocessing on commit message bodies prior to handing them off to Movable Type: consecutive newline pairs are allowed through and Movable Type interprets these as paragraph breaks; all other newlines are converted to spaces (without this Movable Type would insert line break tags for each one, thus causing the output to be hard-wrapped in the browser.

This allows the best of both worlds: readable, hard-wrapped text in the console and attractive, soft-wrapped text in the web browser.

The cost of all this is that commit message bodies should only be standard text, not code snippets or anything which would require literal newlines to be echoed.

Signed-off-by: Greg Hurrell <greg@hurrell.net>

Posted by wincent at July 19, 2007 10:38 AM