Bug 411902 - Add an option to ignore certain differences (Compare with each other)
Summary: Add an option to ignore certain differences (Compare with each other)
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-28 12:19 EDT by Clemens Hahn CLA
Modified: 2013-07-01 03:48 EDT (History)
1 user (show)

See Also:


Attachments
patch to add feature 'compare with each other (filtered)' (28.66 KB, patch)
2013-06-28 12:19 EDT, Clemens Hahn CLA
no flags Details | Diff
a screenshot of the preferences page 'compare with each other (filtered)' (61.63 KB, image/png)
2013-06-28 12:20 EDT, Clemens Hahn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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)'