You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sebb <se...@gmail.com> on 2010/01/16 14:26:03 UTC

Suggestion for handling LF/CRLF EOL conversions.

Suggestion for handling LF/CRLF EOL conversions.

Some files always need to have the same EOL, for example Windows .BAT
and .CMD  files always need CRLF. AFAIK, shell scripts always need LF.

For such files, set the appropriate svn:eol-style property, so
checkouts will always have the correct EOL. Yes, this may make
editting the files a bit awkward for some - tough.

For files that need to vary between releases - for example README.txt
- you can use an Ant patternset to process them. You can even check
whether the target archive is for the same EOL-style as the host, and
skip conversion for such cases.

Just a thought.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Suggestion for handling LF/CRLF EOL conversions.

Posted by "Preston L. Bannister" <pr...@bannister.us>.
This is kind of old ground. :)

For a Windows .BAT / .CMD file when checked out on Unix, LF is more
pragmatic as an EOL marker (as you might want to edit the text, but are not
going to execute the script). The same logic applies for a shell script
checked out on Windows (where CR LF as EOL is useful).

Turn this around. Text files are most useful checked out as text files -
whatever the platform.

(Went through this with CVS, Subversion, and Mercurial. The implementation
varies, but you want pretty much the same end result, when working
cross-platform.)


On Sat, Jan 16, 2010 at 5:26 AM, sebb <se...@gmail.com> wrote:

> Suggestion for handling LF/CRLF EOL conversions.
>
> Some files always need to have the same EOL, for example Windows .BAT
> and .CMD  files always need CRLF. AFAIK, shell scripts always need LF.
>
> For such files, set the appropriate svn:eol-style property, so
> checkouts will always have the correct EOL. Yes, this may make
> editting the files a bit awkward for some - tough.
>
> For files that need to vary between releases - for example README.txt
> - you can use an Ant patternset to process them. You can even check
> whether the target archive is for the same EOL-style as the host, and
> skip conversion for such cases.
>
> Just a thought.
>