Bug 411902

Summary: Add an option to ignore certain differences (Compare with each other)
Product: [Eclipse Project] Platform Reporter: Clemens Hahn <cleemansen>
Component: CompareAssignee: Platform-Compare-Inbox <platform-compare-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: cleemansen
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch to add feature 'compare with each other (filtered)'
none
a screenshot of the preferences page 'compare with each other (filtered)' none

Description Clemens Hahn CLA 2013-06-28 12:19:42 EDT
Created attachment 232891 [details]
patch to add feature 'compare with each other (filtered)'

It would be great to have the opportunity to define a set of rules in order to ignore certain differences between files in a tree compare.
E.g. the line with the CVS/SVN keyword 'Id' changes after every commit, which is a difference that one might want to ignore. (see also [01] [02] [03])
Using Regexes to define ignored changes, such a line of change could be ignored with a Regexp like '.*\$Id:.*'.
Also other rules could be useful such as ignoring changed imports ('^import.*').

We implemented our own plugin which supports an option to define a list of ignored changes for a tree compare.
If a regexp matches a change, this change will be ignored and the corresponding file will not show in the compare tree unless there are other not-ignored changes in the same file [04].
However, as we feel that this feature could also be useful for others, we'd like to share it with the eclipse community if there is interest.

A simple way to add this to eclipse would be to add a menu entry to the context menu:
'Compare With > Each Other (filtered)'.
Also the option to configure the ignore regular expressions could be added to preferences page 'General > Comapare/Path'.

We are pleased to provide you a sample implementation of this feature [05].

A few words to the attached patch:
We could not checkout the compare module from the CVS repo [06]. So we started this patch with the Kepler SDK: org.eclipse.compare (3.5.400.v20130514-1224).
I hope you can work with it. If you prefer a different form of the patch let me know it... 

Regards
Clemens

[01] https://bugs.eclipse.org/bugs/show_bug.cgi?id=110905
[02] https://bugs.eclipse.org/bugs/show_bug.cgi?id=188050
[03] https://bugs.eclipse.org/bugs/show_bug.cgi?id=248827
[04] see attached screenshot 'filteredCompare_PrefScreen.png'
[05] see attached patch 'patch_filteredCompareWithEachOther_0.0.1.patch'
[06] git cvsimport -v -C eclipse-compare_cvsrepo -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse -r cvs org.eclipse.compare
Socket to dev.eclipse.org: Connection timed out
Comment 1 Clemens Hahn CLA 2013-06-28 12:20:46 EDT
Created attachment 232892 [details]
a screenshot of the preferences page 'compare with each other (filtered)'