How can I make Eclipse ignore EOL type in compares? [message #639591] |
Tue, 16 November 2010 23:48  |
Eclipse User |
|
|
|
I'm running Eclipse on a Windows box, accessing files on a drive that is mapped from a Linux box. Everything works fine doing this except for compares. Since Eclipse is running on Windows, it assumes CRLF for line ends. The files themselves though are housed on a Unix box and have LF line ends. As a result, the Eclipse "Compare with base revision" command thinks that every line has a change. If I do a diff using TortoiseSVN or run a "svn diff" from the command line, these operations ignore the line ends, which is what I want.
I've looked through all the various preferences screens in Eclipse to see if there is a way to make Eclipse behave this way but I cannot find anything. The closest was to make Eclipse ignore whitespace but that does more than I want. Is there anyway to make Eclipse ignore line ends when doing compares?
|
|
|
|
|
|
|
|
Re: How can I make Eclipse ignore EOL type in compares? [message #714469 is a reply to message #640331] |
Wed, 10 August 2011 11:13   |
Eclipse User |
|
|
|
I have the exact same problem described by the original poster using CVS, and I'm also hoping it gets fixed in the foreseeable future, or a workaround is found for this.
A couple of comments to add to what was said above:
1. From what I've noticed, the files are saved from Eclipse (running on the Windows machine) through the samba drive on the Linux machine without the CR (e.g. only LF), which is the behavior I expect/want. However, when you try to compare the file to the CVS HEAD version in Eclipse, Eclipse seems to checks out the HEAD version with CR+LF ending each line, which is then compared to the local copy on the Windows having CRs only. This obviously produces diffs on all lines due to the extra CRs.
As the original poster noted, the only way to turn off this behavior seems to be to have the compare ignore whitespaces globally, which is not the desired behavior. The behavior I'd like to see is Eclipse being able to ignore only the CRs when it checks out a version from CVS for comparison.
2. Another related problem: in the project explorer, Eclipse shows differences on these files compared with the CVS repository (i.e. it preceeds their names with a ">" character), making it impossible to distinguish visually which files have actually been locally modified without checking each file independently. Checking these files manually using "Compare with -> Latest from HEAD" confirms that the differences are only in the extra CRs. The desired behavior is to have the Project Explorer automatically disregard CR-related differences when marking files as locally modified.
3. The files under the CVS directory (CVS/Root, CVS/Repository and CVS/Entries) are overwritten by Eclipse. The problem is they are written to the Linux filesystem through the samba mount using the originating OS's newline conventions, which is CRLF on Windows. This breaks down the command line CVS on the Linux since it can't handle the extra CRs, and requires their removal to work. I've written an alias to do just that, and have noticed many others on the web have done the same. I wonder whether there's a way to instruct Eclipse to never add these CRs, or to format the newlines according to the target platform where the CVS server resides rather than the source platform on which the Eclipse CVS client is run.
Thanks,
Ben
EDIT:
I seem to have found an option that resolves issue #1 above, by turning off the whitespace ignoring in compare and turning on instead:
Team -> CVS -> Files and Folders -> Uncheck "Convert text files to use platform line ending"
This worked for me (required restart of Eclipse to update).
I still don't have any solutions for issues #2 and #3. Any suggestion are welcome.
[Updated on: Thu, 11 August 2011 05:46] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.11736 seconds