Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinMerge: how to ignore comments

I'm using WinMerge to compare java files in folders (including subfolders). I would like to ignore comments when the comparison is done, but I don't know how to do it.

At the file level I've found a switch in the option, so if I compare two files the comments are ignored. However if I compare the folders where those two files live WinMerge tells me that the files are different. Then when I click on the files WinMerge finds out that the only differences are comments and it tells me the files are equal.

Any idea?

like image 724
javaExpert Avatar asked Aug 23 '10 09:08

javaExpert


People also ask

How do I ignore a carriage return in WinMerge?

By default, WinMerge compares line ending styles. To disable it, click Edit → Options. In the Compare page, enable (check) the option, Ignore carriage return differences.

How do I change the encoding in WinMerge?

You have an option in File > File encoding... that lets you select the loading codepage for the left or the right file. If you select just one of those and set the encoding so that it matches the other one, it should solve your problem.

How do I filter files in WinMerge?

When selecting a file or folder, hit select right next to the filter textfield to select a filter. Then hit new, select a filename and adjust the filter by the above lines. After saving, you may have to refresh the filter page by closing and opening it again. Select your new filter and voila.


1 Answers

You could use a plugin IgnoreCommentsC.dll. The plugin ignores comments within //... and /* ... */ delimiters in C, C++, PHP and JavaScript files.

You could just associate it with java files. Download from here.

EDIT: It seems that the link doesn't have the plugins downloadable anymore. The documentation says to install plugins at installation time. You can find more information about plugins in the documentation (general info, available plugins)

like image 149
Andrea Avatar answered Sep 24 '22 02:09

Andrea