afnanenayet/diffsitter
View on GitHub ↗ ★ 2,408 Rust
A tree-sitter based AST difftool to get meaningful semantic diffs
17 mentions on Hacker News by 17 people: 3 stories, 14 comments · first 2021-07-08 · latest 2026-06-17
20082026
-
…can use custom diffs for merges, git diff, etc. pretty easily. There are projects like diffsitter ( https://github.com/afnanenayet/diffsitter ) for doing more intelligent diffs like this for supported languages. EDIT: and then an example…
comment by simcop2387 · 2026-06-17 · in Lore – Open source version control system designed for scalability -
▲ 151
Diffsitter – A Tree-sitter based AST difftool to get meaningful semantic diffsstory by mihau · 2025-07-10 · 46 comments
-
…pattern matching would be awesome. Nothing wrong with being a Rust fanboy :), I have written some ( https://github.com/afnanenayet/diffsitter ).
comment by affyboi · 2025-05-08 · in Matt Godbolt sold me on Rust by showing me C++ -
▲ 4
Diffsitter, a tree-sitter based AST difftool to get meaningful semantic diffsstory by cosmojg · 2025-03-07 · 0 comments
-
for diffing syntax trees, I've been trying out diffsitter, and it feels pretty good so far https://github.com/afnanenayet/diffsitter
comment by amar1729 · 2025-01-06 · in The evolution of a structural code editor -
I'm pretty sure this counts. https://github.com/afnanenayet/diffsitter Certainly the idea has been suggested many times. I think people end up formatting both before/after and doing a diff on formatted before against formatted after. I've…
comment by benatkin · 2025-01-03 · in Types are a basic tool of software design (2018) -
…exactly means, but diffsitter uses tree-sitter and it is comparing ASTs and CSTs of the files. [1] https://github.com/afnanenayet/diffsitter
comment by emporas · 2024-07-22 · in How far should a programming language aware diff go? -
Or https://github.com/afnanenayet/diffsitter . I've tried both and I like them. No preference or notable opinions on them yet!
comment by dorian-graph · 2023-12-10 · in AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting -
…two tools that I have seen that use tree-sitter for diffing: https://github.com/wilfred/difftastic https://github.com/afnanenayet/diffsitter (I have not tried either personally.)
comment by b3morales · 2022-11-24 · in Emacs: Feature/tree-sitter merged into master -
One more tree-sitter based diffing tool - diffsitter https://github.com/afnanenayet/diffsitter
comment by yewenjie · 2022-09-07 · in Difftastic, the fantastic diff -
…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…
comment by WorldMaker · 2022-07-05 · in What comes after Git -
…Git diffs, there is Diffsitter, which uses Tree Sitter to generate semantic diffs of code files: https://github.com/afnanenayet/diffsitter I have not used it, but it is high on my todo list.
comment by nerdponx · 2021-09-28 · in What if Git worked with programming languages? -
I think everyone may be interested in: https://github.com/afnanenayet/diffsitter Github having an option to have their PR GUI use an AST diff like this could be a fun and useful option.
comment by res0nat0r · 2021-09-27 · in What if Git worked with programming languages? -
Counterpoint: a quick google reveals diffsitter: https://github.com/afnanenayet/diffsitter The output could be a lot more compact, it could do better at adding context (in the same way https://github.com/romgrk/nvim-treesitter-context…
comment by cormacrelf · 2021-09-27 · in What if Git worked with programming languages? -
…tree-sitter. The method used by diffsitter is to compute the path with minimal editing distance: https://github.com/afnanenayet/diffsitter/blob/main/src/ast.... . In the case where the edits are known (because you're re-creating the AST…
comment by bhl · 2021-07-18 · in Diffsitter: A tree-sitter based AST difftool to get meaningful semantic diffs -
▲ 213
Diffsitter: A tree-sitter based AST difftool to get meaningful semantic diffsstory by todsacerdoti · 2021-07-18 · 53 comments
-
…this project, I wondered specifically about Treesitter's applicability to this problem, and I found https://github.com/afnanenayet/diffsitter . Maybe there's something to be learned there?
comment by zhengyi13 · 2021-07-08 · in Difftastic: Syntax-aware structured diff tool