Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 4.11.2
Description
Compared to some other diff tools, Qt Creator lacks the ability to ignore all whitespace and case.
About whitespace, it is already able to detect indentation, but not line break :
int a = 0; //Will be considered different than int a = 0;
This could be improved (but not completely fixed) by changing this file, line 367 to:
if (ignoreWhitespace()) { realArgs << "--ignore-space-change" << "--ignore-space-at-eol" << "-b" << "-w" << "--ignore-blank-lines" << "--word-diff-regex=[^[:space:]]"; }
A way to fix it completely would be to apply clang format to both files before comparing them. This way, all the formatting changes would completely disappear.
Another way, only using Git, might be to use this command, allowing to commit while ignoring whitespace (explanation here)
git diff -w --no-color | git apply --cached --ignore-whitespace && git checkout -- . && git reset && git add -p
Furthermore, it also lacks the ability to ignore case. This is secondary and way less helpful than ignoring whitespace, but still useful in some very particular situations.
int A = 0; //Will be considered different than int a = 0;
In my opinion, Qt Creator diff is already great, and these options would make it even better.