[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: What do you Hate about Subversion?

From: L. Wayne Johnson <wayne_at_zk.com>
Date: 2007-01-30 22:09:13 CET

>>
>> Wayne,
>>
>> Try any modern text editor on any platform and it correctly handles the
>> situation you describe. Even wordpad.exe on Windoze can correctly render
>> your hypothetical text file containing an amalgam of line ends from
>> Win/Mac/Lin sessions.
>>
>> If your editor doesn't already handle this, I'd be surprised.
>>
>> The algorithm to handle this situation is trivial and as I posted
>> earlier,
>> well understood for at least the last 20 years.
>>
>> It requires the tool's lexical analyzer have one character look ahead (if
>> you're a coder), and then the algorithm is:
>>
>> If the current character if CR and is followed by LF, generate a single
>> new
>> line (e.g. ++line_number).
>>
>> Else, if the current character is LF and is followed by CR, generate a
>> single new line.
>>
>> Else, if the current character is CR or LF generate a single new line.
>>
>> That's it. Works for Win/Lin/Dos/Mac, and even works for files that are
>> munged between the two.
>>
>> Enjoy!
>>

That's all fine and dandy *but*:

1.) This is still *not* an official standard.

2.) Even it it were made a standard, it is not always possible to pick your
tools.

I think that most of the tools I use will handle the mixed line feeds. I am
not sure because I do most of my work on Windows. However, some of my work
requires that I use specific tools. There is nothing wrong with these tools
per se. They were designed to run on Windows and they work when they are
handed *valid* Windows text files. It hardly fair to say a Windows tool
designed to work with Windows text files is busted because it won't handle
Mac or Linux EOLs.

And as indicated once the EOL's are mixed it might be impossible to extract
the original format. And yes, sometime the format DOES matter.

I exit this thread now, I've got work to do ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 30 22:09:42 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.