Community
Participate
Working Groups
I use a third party Ajax package (Dojo) which has a file called -.gif. Basically once I commit this file to CVS on Linux, I am unable to delete and commit the delete because the diff fails. This is because dash (-) is a metacharacter on the Linux file system (signals a command switch) and the remote commands seem not to be dealing with it. Steps to reproduce: -------------------------------------------------------------------------------- 1) Connect to a CVS repository stored on Linux 2) In a shared project, create a file called -whatever 3) Commit the new file 4) Delete the file -whatever in your workspace 5) Try to commit the deletion, you get the following error: The server reported an error while performing the "cvs commit" command. com.ibm.jsdt.core: diff: invalid option -- m com.ibm.jsdt.core: cvs server: Try `diff --help' for more information. com.ibm.jsdt.core: cvs [server aborted]: error diffing -whatever The manual workaround is to log into the Linux box, cd to the directory containing the -whatever file, and performing the command: rm ./-whatever The ./ (current directory) syntax avoids dealing with the dash (-) metacharacter.
How did you commit the file? Did you use the CVS command line (i.e. I get an error from the server when I try to commit such a file from within Eclipse)? Can you delete the file using the command line client as well?
I successfully committed the file using the Eclipse UI (right-click file, Commit). I've never used the CVS command-line so I haven't tried this and would prefer not to learn if possible (after all, the Eclipse/CVS GUI integration is SOOOOO NICE, how could I ever use a command line again <g>)
The error is coming from the server. Either the server doesn't support it or, what is more likely is that we need to escape the - in some form when we send the file name argument. We should be able to find out by getting the log from a command line operation. However, we wont have time to look at this in 3.3.
Michael, for me it is server error. I have search the cvs manual, and have found that some commands have additional clues for handling files placed after the file name. f.e. "FileName -kb" means that specified file should be treated as binary one. I have tried to escape the '-' with "\-" but the result always remains the same - invalid option. I think it is CVS bug.
What you need to do is see what happens when you use only the command line client. If you can commit the file and delete the file using the command line client then we should be able to do the same things from within Eclipse.
On CVSNT, you cannot even add such a file to the repository. I have dig through the clientserver protocol, and there is no single word about escaping filenames. if I have a sec, I will try to capture cvs command client (that works pretty well) trafic and see, if there are any differences.
Do you have access to a Linux box? It would be better to test with the *nix CVS. While the behavior of CVSNT is close to the standard CVS server, it is not the same, especially in the area of supported characters in file names.
Created attachment 67946 [details] Fix I have found escape sequence - it is "./". Added in two places, tested for commit, synchronize, update and remove - works well.
Patch released to HEAD
Verified in I20070806-1800. It works even for nasty-named files and folders