top | item 37995830

(no title)

guiraldelli | 2 years ago

It might be because of formatting, but that is exactly what I would have expected them to handle well.

Anyway, I have used a FOSS that does that, difftastic [1], and it does a pretty good job at language diff'ing without the annoyance of formatting as I hypothesised earlier.

[1]: https://github.com/Wilfred/difftastic

discuss

order

shiroiuma|2 years ago

Why would you want to diff code and ignore formatting? If it's just whitespace changes, any decent diff program should have an option to ignore that, but if it's more substantial, I would want to see that in a PR.

If, for some odd reason, I wanted to compare two codebases that had diverged, and one had gotten some serious formatting changes (maybe the new person preferred a different coding style), I'd run them both through an automatic formatter program with the same options. For C code, "indent" is commonly available, for instance.