31 October, 2009

CVS client in Cygwin and CVSNT doesn't play with each other!

I have puzzled by the strange CVS error for a few weeks and finally I sit down and dig out the real problem. If you need to use CVS on Windows and you are a Cygwin user, read on!

If you checkout the source using CVSNT client, and try to use Cygwin client to do other CVS operation, you will found CVS client will quickly failed with the error: "Repository not found".

If you try to checkout the source using Cygwin client and try to use CVSNT client to do other CVS operation, the CVSNT client will have strange result too.

The real reason is the silly line-ending issue. CVSNT will always convert sources from Unix line ending to DOS line ending, including the CVS specific files (CVS/Root for example). If you don't enable the line-ending conversion in Cygwin (I never do this), Cygwin client will never read the CVS file correctly, and no CVS operation can be performed properly.

On the other hand, if you checkout the source using Cygwin client, all source files and CVS specific files will be in Unix line-ending. CVSNT client cannot handle this properly too! There is a setting in CVSNT client to treat the work copy in Unix line ending, but it just seems doesn't work for me.

The solution? Stick with only one tools. I choose to stick with Cygwin client as it is the more natural for me. In additions, I found Eclipse and NetBeans can handle the source checked out via Cygwin client and CVSNT client. Hence, I haven't yet got any functionality miss out in Cygwin client + Eclipse/NetBeans combination.

There is a entry in Cygwin FAQ to enable the DOS/Unix line ending conversion mode in Cygwin, I haven't try this as I believe this mode may cause some problems on other programs / tools in Cygwin.

If you need a more details on this issue, the following places may helps:

No comments: