Quoting from the article, … depending on the type of formatting, can also damage your ability to effectively compare revisions in source control, which is really scary. …
In answer to that problem, why isn’t there a syntax/semantics sensitive compare utility?
What I mean is, I would like a version compare utility that knew what was significant and what was insignificant. It would have classes of changes to be checked for that could be controlled independently.
The most restrictive level would flag every mismatch of whitespace, tabs, newlines, comment text, and everything above that. A somewhat more lenient level would ignore semantically meaningless differences in whitespace, tabs, newlines, etc (but not in strings, presumably), but would flag other changes.
The most lenient level would NOT flag anything but semantically meaningful differences.
For instance, and assuming all references were also changed consistently, renames inside a function of arguments and local variables would not be flagged as changes.
Also, renames of private functions would not be flagged as changes.
This would solve the problem of code reformatting and code cleanup making it difficult to compare revisions. With the current compare technology, a simple reformatting of the code can make the revision compare system flag practically every statement in the source file, making it difficult to find the real changes.
Does anything like this exist?