CVS Problems

"Matt Brozowski" <[email protected]> Mon, 2 Feb 2004 23:57:09 -0500
Newsgroups gmane.comp.ide.eclipse.plugins.wdte.devel
Message-ID <001201c3ea12$2e8a43b0$0300a8c0@oemcomputer>
I was trying out the CSS Editor that is currently up in CVS so I could
a little more familiar with so I can begin to contribute.  I found a
bug and decided I would debug and submit the fix as a patch to the
mailing list.  It was a very simple fix of a very small change to only
a single line of a single file.  I decided to call Team -> Create
Patch from the popup menu for the source file and put it on the clip
board and paste it into an e-mail.

Unfortunately, the patch indicated that every line of the file was
changed.  SOOOO after trying it with cvs commands directly and having
no problems I decided to debug it.

The problems is this:

When creating a patch (using the pserver protocol at least), Eclipse
sends the files that are modified to the CVS server and the server
compares them to the files that are in the repository.   It then sends
the diff results back to be incorporated into the patch.  The
convention seems to be that, when file contents are sent to the
server, lines are terminated with a LF in the Unix style.  Therefore
on Windows sytems CRLF files have the CRs stripped out.

It appears that the files that are checked into CVS and stored in the
repository for the CSS Editor are CRLF terminated. When the files are
checked out the CRLF remain the files stored locally.  After making a
modification, and attempting the create a patch, Eclipse, recognizing
that it is running on a Windows box, removes the CR when it sends the
contents of the modified files back to the server.  The CVS server
then compares the CRLF version of the file in the repository with the
LF only version that is sent from the client and as a result it thinks
that every line is different. (Note that this doesn't happen on a Unix
system because it does not attempt to the CRs from the communication,
but the impact on a Windows system is that only completely
unreasonable patches can be made.)

It seems that all of the files that are currently in WDTE CVS have the
CRLF in them.

I would recommend that all the files in CVS be converted to LF only
files to avoid this problem in the future.

Further I would be very interested to know how the files got checked
in initially so we can be sure that Eclipse is not causing the trouble
itself.

I'm happy to do any futher investigation if any is necessary.

--
Matt Brozowski



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn