info-cvs
[Top][All Lists]
Advanced

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

RE: Help and info on line endings


From: Jim.Hyslop
Subject: RE: Help and info on line endings
Date: Wed, 28 Jan 2004 12:08:30 -0500

Les Spam [mailto:address@hidden wrote:
> We have been having trouble with line endings because we 
> check out files 
> on a Linux server and zip them up for download by users who 
> do not have 
> CVS clients. Win9x users end up with line oriented text files that do 
> not parse because the scanner sees one long line.
The conventional advice is to check out onto the same platform that the end
users will be using, and let CVS handle the line ending translation. That
should solve your headaches.

> Looking 
> inside the CVS files, we see they have *DOS* line endings for the 
> relevant lines and Unix line endings for the rest. There is a 
> reference 
> to "canonical form" in the CVS docs for the -kb flag, from which we 
> infer that the CVS files are supposed to have only Unix line endings. 
> Can anyone explain how/why it is that the DOS line endings are being 
> preserved in these CVS text files?
Exactly what's stored inside the RCS file is not important. The important
question is: what do you see when you check out the files? Do you see the
appropriate line endings for the platform you've checked it out onto?

> We are not that happy with this unix2dos solution because: 1) it can 
> screw up parsing the files on Unix or Macs, 2) people forget 
> to convert 
> the files, and 3) it doesn't work for everyone, every time (and we 
> haven't figured out why - any ideas?).  We could get a 
> consistent result 
> by converting to DOS and checking  these files in as binary, but we 
> don't like that approach for reasons 1) and 2). Does anyone 
> have other 
> suggestions?
Check the files out, and examine each line feed to make sure it is
appropriate for the platform you're on. Fix up any line endings as
necessary, then check the file back in. Make sure you do all this work on
one machine, with one type of command prompt (i.e. don't check them out on
Windows with a cygwin client, then use a standard Windows command prompt to
edit the files or check them back in).

Also, you haven't mentioned your access method. Do not use mounted
directories for your repository - that's one sure way to get things screwed
up, and not just for line endings.

-- 
Jim Hyslop 
Senior Software Designer 
Leitch Technology International Inc. (<http://www.leitch.com/>) 
Columnist, C/C++ Users Journal (<http://www.cuj.com/experts>) 






reply via email to

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