What does HackerNews think of difftastic?
a structural diff that understands syntax 🟥🟩
The idea is that it does not show diff based on text change, but on syntastic meaning. For that, it uses tree-sitter.
I think it still shows the trailing comma in the situation as shown in the article, but it's quite different experience than the standard text based diff.
treesitter tech always seemed cool, but never felt I had access to it on my finger tips. one such tool is https://github.com/Wilfred/difftastic (semantic diff)
will definitely be trying this out.
If I am just living in the terminal, I like to use a mix of https://github.com/extrawurst/gitui (doesn't support signed commits yet!) and https://github.com/Wilfred/difftastic which provides amazing semantic diffs.
[0] https://github.com/Wilfred/difftastic [1] https://difftastic.wilfred.me.uk/languages_supported.html
I use delta as my daily driver but sometimes when I want the contextual info, switching to `env GIT_EXTERNAL_DIFF=difft git log -p --ext-diff` gives a better picture.
I know a lot of people who have a lot of hope for diffsitter (or something like it): https://github.com/afnanenayet/diffsitter
Personally, I think the reason most "good" semantic diff tools are proprietary is that they are huge amounts of effort that are mostly "hacks" and "heuristics" bandaged together in ways that people don't want to let out how the sausage was made.
But I also think "general, language agnostic AST-based semantic diff" is a mountain peak we cannot reach (probably ever), and I believe my experiments found an interesting local maxima that people are maybe passing by on the way to that ideal mountain (lexer-based diffs rather than parser-based diffs): https://github.com/WorldMaker/tokdiff
I feel that once tools like Difftastic [1] and similar get more mainstream, and ideally more firmly entrenched within git itself, it will make code reviewing much smoother process rather than having to depend on Github or any other proprietary service.
in case anyone missed it: https://github.com/Wilfred/difftastic
https://github.com/Wilfred/difftastic
I'm currently trying this out, but I'm not sure if I'll keep using it.