After spending too much time trying to understand how line filters work in
WinMerge, I gave up and decided to write this plug-in so that I won't lose time
again.
I'm sharing it for the community to gather feedbacks and improvements. I
developed this overnight. Do not expect too much robustness. My feeling is it
works.
If it doesn't for you, give me an example or post to forum. I'll try to improve
this as I find time.
There are two plug-ins available for WinMerge. They enable you to filter
unimportant text during comparison. There is a central rule file which is
located
on your c:\ folder. (The folder is fixed as of this moment. We can fix this
later).
See the
SourceForge website for an example rule file.
Download the zip that contains the binaries directly from here. Download the example rule file too.
preDiffer plug-in is used to apply regular expression filtering on per file
basis. You compare your files as usual. Then enable the preDiffer
from plug-ins menu.
It tries to hide unimportant differences according to rules in regexrules file.
The caveat is that you 'll have to enable it every time you compare the files.
It is off by default.
I could not find a way to enable it by default. Maybe this behavior will change
overtime.
WinMerge unpackers are associated with file extensions. There may be multiple
unpackers per file type. I have removed ignoreCommentsC plugin from
my WinMerge installation folder so that regex unpacker can have a chance to
work. WinMerge chooses the unpacker according to alphabetical order.
When WinMerge sees a file of known extension, it executes the unpacker on every
matching file on a directory comparison. This is more useful then preDiffer
if you have too many changed files. You'll not be able to modify the compared
files as the shown file is different from what it is in the original place.
Use your text editor for changing differences.
Unpackers can be enabled/disabled from Plugins menu item. Choose automatic unpacking if you want to ignore the files that you are not interested in. Then, start your comparision.
I usually compare the folder using the unPacker first.
Do not belive in the description. I stole the solution file from XML unpacker. I'll fix the description one day.
This eliminates all the files that I'm not interested in.
After the comparison, I turn off the automatic filter by choosing the Manual Unpacking from plug-ins menu.
Next, I open the file by double clicking it. It is going to show all the important and unimportant differences.
Go-to Plugins menu item again. Choose prediffer and then regexPrefilter.dll.
Unimportant differences are gone again.
The nice thing about prefilter mode is that you can modify the files on the fly. You can change them and save them because differences are still visible. It is just WinMerge that does not highlight them as different. This allows you to make all of your changes on a single program. You do not need to move forth and back between your editor and comparision tool.
Don't forget to disable unpacking if you want to use preDiffer. Otherwise, WinMerge will tell you that you cannot save your modification.