Search code examples
language-agnosticversion-controlcygwincvsfile-format

Why does a file checked into CVS become double-spaced?


Problem

Frequently (but not every time) when using CVS to check in files like: .java, .cs, .xml, etc, every line of the file is gets a carriage return.

Example:

File before check-in by a team member:

// Begin file
    class Foo
    {
      public Foo()
      {
        // Do step 1
        // Do step 2
      }
    }
// End file

File when checked out by a team member:

// Begin file

    class Foo

    {

      public Foo()

      {

        // Do step 1

        // Do step 2

      }

    }

// End file

Development Environment

  • NetBeans 6.8 and now 6.9 (the problem occurred when using 6.8 as well).
  • Visual Studio 2008 and 2010.
  • Repository: CVS; checkins and checkouts done from Cygwin bash shell.
  • Operating system: Widows XP Professional.

What I Have Tried

I tried changing the value: build.compiler.emacs=true within NetBeans under Tools->Options, thinking this might be causing some kind of Unix/Windows translation problem when checking in? This made no difference.

Am I missing something about what happens to a file when it gets checked into CVS in a Windows/IDE/Cygwin stack that can cause this problem?


Solution

  • Something is converting DOS line breaks (CR LF) to pairs of Unix line breaks (just LF). I would personally bet on its being CVS. You might want to try using TortoiseCVS instead of Cygwin CVS.