3 ms·
> I am curious if there’s been any work on _semantic_ diff tools as well (for when eg the syntax changes but the meaning is the same) So when using such a diff
by rob74 3y ago
> I am curious if there’s been any work on _semantic_ diff tools as well (for when eg the syntax changes but the meaning is the same)
So when using such a diff tool you can spend hours refactoring something, and then git will refuse to commit your changes because your refactoring was successful in not changing the behavior of the code? I understand what you mean, but if we arrive at that point maybe we should stop calling it "diff", to avoid confusion...
- kstrauser 3y agoGit doesn't use the output of `diff` to determine whether anything has changed.
- samatman 3y agoTrue, although not widely known it would seem. It does use diff to generate patches, however. I know in today's GitHub-dominated landscape, that's considered a bit of a dusty feature, but it would be a pity to break it.
- viraptor 3y agoIf you want to generate patches rather than look at local differences, there's a specific command for that - https://git-scm.com/docs/git-format-patch https://git-scm.com/docs/git-format-patch