Hacker GitHub

← All repos

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

Mentions per year 17 mentions · busiest year 2021 (6)
20082026
  1. …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…
  2. …pattern matching would be awesome. Nothing wrong with being a Rust fanboy :), I have written some ( https://github.com/afnanenayet/diffsitter ).
  3. 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
  4. 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…
  5. …exactly means, but diffsitter uses tree-sitter and it is comparing ASTs and CSTs of the files. [1] https://github.com/afnanenayet/diffsitter
  6. Or https://github.com/afnanenayet/diffsitter . I've tried both and I like them. No preference or notable opinions on them yet!
  7. …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.)
  8. One more tree-sitter based diffing tool - diffsitter https://github.com/afnanenayet/diffsitter
    comment by yewenjie · 2022-09-07 · in Difftastic, the fantastic diff
  9. …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
  10. …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.
  11. 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.
  12. 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…
  13. …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…
  14. …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?