0

Looking for a diff tool (preferably with GUI, for Windows, and free, but others are welcome too) that can ignore newlines, so diffs that are only lines joined or broken are ignored. It should also have the option to ignore other "white space only" changes.

For example:

void foo(){
    int a=1+2;

void foo()
{
    int a = 1 + 2;

These two should compare as "no changes".

(the above is just an example, it should handle all/most textual file types, not just C)

3
  • When it comes to source code I would suggest to apply a source code formatter onto both code files/directories so that formatting changes are ignored.
    – Robert
    Sep 16 at 9:53
  • That would work in some cases, but I'm looking for a tool to compare unchanged input files. Sep 16 at 10:49
  • See also askubuntu.com/questions/1073349/…
    – Robert
    Sep 16 at 11:06
0

IntelliJ IDEA * has a builtin file compare with several options. One of them is "Ignore whitespaces and empty lines" which does what is asked for.

* currently at version 2021.2.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.