info-cvs
[Top][All Lists]
Advanced

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

Re: CVS and ^M


From: Mike Ayers
Subject: Re: CVS and ^M
Date: Fri, 26 Jul 2002 09:47:18 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530

Carsten Friedrich wrote:
> Hi,

        Hello.

> I looked at the FAQ, but it wasn't there. Maybe somebody can help:
>
> I'm working on a Windows 2000 machine with cygwin installed.

        Okay, off to a bad start...

> I set up cvs to use :ext:... to keep my repository on a unix server.

        No problem here.

> When I update files now (which I have previously edited on windows),
> they suddenly have a ^M at the end of every line which is a little bit
> annoying. Is there a way to stop cvs from adding ^M?

        CVS is not adding the LFs (^M is the graphic representation of LF, the 
ASCII
linefeed character).  You are using a native windows editor (or some other
form of processing) on your files, and it will (correctly) use CR/LF line
terminators, as these are the proper line terminators for Windows systems.
However, the CVS client you are using was compiled for Cygwin, a Unix
emulation environment for Windows, and therefore expects Unix style text file,
i.e. CR only.  There are two ways to handle this, pick the one which suits
your needs better:

        1)  Don't use the Cygwin CVS client, download WinCVS from cvsgui.org 
and use
it, as it will correctly handle CR-LF files.  This is a good answer if you are
using only Windows tools.

        2)  Write a commit script that runs dos2unix on the file before cvs 
commit.
This is a good answer if you are using a mixed bag of tools and are willing to
do command line CVS operations.

        Now, what to do about all those files in the repository that have extra 
LFs in
them?  Again, pick your poison:

        1)  Check out the entire tree from Cygwin, run dos2unix on each text 
file, then
commit any files that changed.

        2)  Write a diff script to do `cvs diff -b`, which will ignore 
differences in
line terminators when diffing.

        3) Open each text file in emacs.  Look for "(Unix)" in the status bar.  
If it's
there, add ^M to the end of any lines that don't already have one (type ^Q^M);
if it's not there, remove any ^Ms (I use replace-string/^Q^M//).  Commit any
files that change.

        Hope this helps,


/|/|ike





reply via email to

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