[ITK] Word wrap for commit text at itk.org/gitweb and review.source.kitware.com?
Niels Dekker
niels-xtk at xs4all.nl
Thu Feb 26 11:21:19 EST 2015
Thanks for your reply, Matt. I agree that it's useful to have a maximum
line length for C++ code, especially because C++ code may not look so well
after word wrapping. However, for informative text, like commit messages,
I still think automatic word wrapping would be preferable to asking each
committer to insert hard-coded line breaks into paragraphs, or even into
sentences.
Automatic word wrapping techniques were developed by D.E. Knuth et al,
more than three decades ago
<http://en.wikipedia.org/wiki/Line_wrap_and_word_wrap>, so I'm surprised
that many tools still do not implement them.
It seems to me that the missing word wrapping in
http://review.source.kitware.com/#/c/19311/ and
http://itk.org/gitweb?p=ITK.git;a=commit;h=bbecc3b7cca9f85914235dac2d6b9e80d0d44dda
might both be caused by HTML bugs. If that's the case, I'd probably have
to report them elsewhere, right?
Kind regards, Niels
> Hi Niels,
>
> It would be nice to use automatic wrapping everywhere, but
> unfortunately many tools do not support it, so we use the hard
> wrapping. ITK style guidelines [1] [2], specify line lengths of 79
> characters for things like commit messages and up to 200 characters
> for code lines.
>
> Thanks for the feedback,
> Matt
>
> [1] http://www.itk.org/Wiki/ITK/Coding_Style_Guide
>
> [2]
> http://itk.org/gitweb?p=ITK.git;a=blob_plain;f=Documentation/Style.pdf;hb=HEAD
>
> On Wed, Feb 25, 2015 at 6:50 AM, Niels Dekker wrote:
>> The commit log text of the commit I submitted to Gerrit yesterday had a
>> paragraph of more than 280 characters, without "hard" line breaks. Now
>> it appears as a single line, without any line wrapping, both at Gerrit,
>> http://review.source.kitware.com/#/c/19311/ and
>> http://itk.org/gitweb?p=ITK.git;a=commit;h=bbecc3b7cca9f85914235dac2d6b9e80d0d44dda
>> At least that's how I see it on Windows7 + Firefox 35. Which makes
>> reading the text a bit uncomfortable: I'd have to use the horizontal
>> scrollbar of the web browser to get to the end of the line.
>>
>> Do other platforms/browsers/devices display this paragraph in a more
>> convenient way, by adding word wrapping?
>>
>> Otherwise, is it possible to enable word wrapping for itk.org/gitweb and
>> review.source.kitware.com?
>>
>> I prefer automatic word wrapping to hard line breaks, because the
>> optimal position of a line break within a paragraph very much depends
>> on the viewing device, the viewing software, and the preference of the
>> user who is reading the text.
>>
>> See also http://en.wikipedia.org/wiki/Line_wrap_and_word_wrap
>>
>> BTW: Here's the log text from
>> http://review.source.kitware.com/#/c/19311/ :
>> ------------------------------------------------------------
>> The original itk_module_warnings_disable macro would remove all
>> "/W[0-4]" compiler flags, but then Visual Studio (both VS2010
>> and VS2013) would automatically (!) add "/W1", causing these
>> "D9025" warnings. Visual Studio does not do so when
>> itk_module_warnings_disable adds "/W0" instead.
>>
>> Discussed at "[ITK] ITKModuleMacros.cmake
>> macro(itk_module_warnings_disable)
>> MSVC warning D9025: overriding '/W1' with '/w'",
>> http://public.kitware.com/pipermail/community/2015-February/008349.html
>> Mike Jackson confirmed the issue at
>> http://public.kitware.com/pipermail/community/2015-February/008361.html
>> ------------------------------------------------------------
>>
>> Kind regards, Niels
>> --
>> Niels Dekker
>> Scientific programmer at LKEB, Leiden University Medical Center
More information about the Community
mailing list