[Top][All Lists]

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

Re: CVS and end of line characters

From: Larry Jones
Subject: Re: CVS and end of line characters
Date: Wed, 26 May 2004 23:04:16 -0400 (EDT)

Jo Vermeulen writes:
> In Vim every line ends with a ^W character. In Emacs it is displayed as a
> ^M character. On Windows every line seems to have an extra carriage return.
> Why does this happen, and what can I do about it?

It happens because you had files with DOS line endings that you
committed on a Unix-like platform.  Because the Unix line ending is just
<LF>, the <CR> at the end of each line was taken as part of the content
of the line rather than as part of the line terminator and stored in the
repository.  When you check such a file out on DOS/Windows, you end up
with <CR><CR><LF> at the end of each line (the <CR> that was stored as
part of the line followed by the usual DOS <CR><LF> line terminator). 
To fix it, you'll have to check the files out on your Unix-like system,
remove the spurious <CR>s, and then commit the fixed files.  To prevent
the problem from reoccuring, never share a working directory between
systems with different line ending conventions (i.e., no Samba mounts,
no copying files back and forth, and no using software that doesn't
adhere to the system's native line ending conventions).

-Larry Jones

Let's pretend I already feel terrible about it, and that you
don't need to rub it in any more. -- Calvin

reply via email to

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