Search: 
 
View
  By section
  As outline
  Fully expanded

FAQ sections
  cvs

Questions
  Getting account
  Getting started
  cvs-remote-links
  CVS Clients
  cvs-local-resources
  common-commands
  common-tasks
  CVS and Eclipse
  admin-commands
  EDITOR-variable
  no password
  cvs-laptop
  change-password
  cvs-authoring
  Administrator/mkpasswd
  CVS account name
  Cygwin home dir
  Cygwin CR/NL problems
  Who gets one?
  anonymous access
  SCCS/RCS/CVS conversion
  Failed to connect . . .
  cvs update is slow
  cvs mail
  Cygwin copy & paste
  CVS Web Interface
  SVN vs CVS
  CVS on the Mac
 
Software Development
FAQ
CVS
Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question

Cygwin CR/NL problems
Christopher Brooks, 26 Aug 2002
Last updated: 10 Oct 2005

When Cygwin is installed, you should be sure to select DOS for the Default Text File Type.
If you do not, then when you check in files, there will be problems with the DOS CR/NL line endings.
In particular, what will happen is that when you check in a file and then someone checks it out, it will have extra \r or ^M characters.

The way to tell if this is a problem is to run the mount command under Cygwin bash and note whether the c: drive is mounted textmode or not. If the c: drive is mounted textmode, then your setup is ok:

$ mount
c:\cygwin\bin on /usr/bin type system (textmode)
c:\cygwin\lib on /usr/lib type system (textmode)
c:\cygwin on / type system (textmode)
c: on /cygdrive/c type user (textmode,noumount)
However, if c: is mounted binmode, then you have problems:
$ mount
c:\cygwin2\bin on /usr/bin type system (binmode)
c:\cygwin2\lib on /usr/lib type system (binmode)
c:\cygwin2 on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)

The fastest solution is to reinstall Cygwin, see How do I edit pages in a group with the "CVS Authoring" option? and properly select DOS for the Default Text File Type.
Another possible alternative is to use these mount commands:
We have tried these commands but they have not quite worked for us

mount -f -t -s c:\\cygwin\\lib /usr/lib
mount -f -t -s c:\\cygwin\\bin /usr/bin
mount -f -t -s c:\\cygwin /
mount -f -t c: /cygdrive/c
If you have a d: drive,you may need to do:
mount -f -t d: /cygdrive/c
When you are done, run mount, which should show all the mounts as textmode.

The reason that this is a problem with CVS is that CVS handles end of line translation between Unix and Windows.
If, under Cygwin, the directories are mounted binmode, then Cygwin CVS will not do the proper translations.
For details, see How is the DOS/Unix CR/LF thing handled? in the Cygwin FAQ
See also http://cygwin.com/cygwin-ug-net/using-textbinary.html

To replicate the problem, install Cygwin with Unix line endings, check out a file using CVS, edit the file using wordpad and check in your changes. When you check out the file under Unix, it will have \r\n line endings.

Note that there is some contention about whether DOS or Unix line endings are correct. The TinyOS community has required Cygwin to be set up with Unix line endings, which works great if your users are technically sophisticated. However, if your windows users do not have much exposure to Unix, then configuring Cygwin to use DOS line endings is more correct.

 
Previous section  |  This section  |  Next section
Previous question  |  This question  |  Next question
You are not logged in
©1998-2008 GSRC