monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: Bug in CRLF conversions


From: Richard Levitte - VMS Whacker
Subject: Re: [Monotone-devel] Re: Bug in CRLF conversions
Date: Mon, 30 Jan 2006 14:08:52 +0100 (CET)

In message <address@hidden> on Mon, 30 Jan 2006 07:36:09 -0500, Ethan Blanton 
<address@hidden> said:

eblanton> Richard Levitte - VMS Whacker spake unto us the following wisdom:
eblanton> > In message <address@hidden> on Sun, 29 Jan 2006 16:26:13 -0500, 
Yury Polyanskiy <address@hidden> said:
eblanton> > ypolyans> Some motivation why maybe it still should be done. Why we
eblanton> > ypolyans> want line endings translation at all? Because frigging
eblanton> > ypolyans> windows software doesn't handle lone \n's or \r's very 
well
eblanton> > ypolyans> (notepad, etc). Mac software I believe is much better in
eblanton> > ypolyans> this respect so they can live w/o translation.  Can anyone
eblanton> > ypolyans> using Mac comment on this?
eblanton> > 
eblanton> > The operating systems usually don't care about line endings, it's 
the
eblanton> > utilities that do.  Try 'cat' with a file that has \r as line 
endings
eblanton> > on most Unix systems, and you will see one fluttering line.  Some
eblanton> > editors have a bit of difficulty with "strange" line endings.
eblanton> 
eblanton> This is precisely why Yury is correct.  Because, on many
eblanton> systems, \r and \n have _different meanings_, they should be
eblanton> properly and reversibly preserved even in text files.  What
eblanton> Yury is saying, if I understand it correctly, is that the
eblanton> following file:
eblanton> 
eblanton> Now is the time\rfor all good\nmen to come to the aid\rof their 
country.\n

Honestly, in a case like that, I have no idea what I'd do with it,
except ask the authors of that line what the hell they are doing.
It mostly looks to me like a MacOS9 and a Unix user tried to
collaborate and sent the file back and forth in binary mode.

Have you actually seen files with that kind of content, or are you
making it up to make your point?  The trouble with the kind of line is
that the meaning will DIFFER depending on the platform if those \r and
\n are preserved as is, and quite honestly, a line like that looks
more like a stupid mistake than something thought out.

I'm a little worried, though, by Bruce mentioning scripts with
embedded \r, which I assume would be part of a sed expression or
something similar.  Such scripts are dicy as soon as you go outside
the Unix world...

eblanton> Would be, after a checkout and checkin with a hook like
eblanton> Yury's:
eblanton> 
eblanton> Now is the time\nfor all good\nmen to come to the aid\nof
eblanton> their country.\n

Actually, with the hook he originally gave us, the checked out result
is even worse:

Now is the time\r\nfor all good\r\nmen to come to the aid\r\nof their 
country.\r\n

However, on Windows, that would probably make sense.

All this, because different platform implementors couldn't agree on
what a line should end with...

Cheers,
Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]