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

Re: Poll: do we really need newline conversion?

From: <peter.westlake_at_arm.com>
Date: 2001-12-11 18:39:34 CET

On 2001-12-11 17:20:37 Karl Fogel wrote:
>Recently, some people posted asking whether Subversion should even
>bother to perform newline conversion.
>
>On pondering the question, I have to admit they have a point. :-)
>
> * Modern text editors handle all newline styles transparently.
> It's true that Windows Notepad doesn't work with LF-only files,
> but then again, Notepad also doesn't do files larger than 32kb,
> so I feel pretty comfortable not worrying about Notepad.

Modern text editors might, but how many other tools do?

bash-2.04$ od -c foo.txt
0000000 h e l l o \r \n
0000010
bash-2.04$ perl -p -e "chomp" <foo.txt | od -c
0000000 h e l l o \r
0000007

How much of the world's computing infrastructure would this break?
There's a *lot* of perl out there. And that was just the first
program I thought of.

Here's the second program I thought of:

bash-2.04$ for x in `cat foo.txt`; do echo line $x; done
line hello
line
bash-2.04$

Here's the third, an emacs buffer:

   hello ^M

So much for modern text editors.

> * Mike Pilato argues (convincingly, IMHO) that newline conversion
> is way outside the scope of a version control system anyway, that
> it's just a weird bit of creeping featurism that doesn't even
> provide something terribly useful anymore, and has the potential
> to damage data (since it's a departure from faithfully versioning
> whatever people checked in).

I don't agree: I think it's a very special and very odd case where
doing the conversion is actually *more* faithful, not less. If I had
checked in that file foo.txt from Windows, where it is a text file
with a single properly-terminated line, then when I check it out on
Unix I expect to see a text file with a single properly-terminated
line. Instead I have a text file with a bogus control character
before the newline, and that isn't what I checked in.

Peter.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:52 2006

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

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