Mergiraf: Syntax-Aware Merging for Git

(lwn.net)

32 points | by Velocifyer 10 days ago ago

4 comments

  • pavelai 10 days ago ago

    Very impressive enhancement. Not a panacea though. It uses tree-sitter approach to solve situations when two users change the same line of code. For example one change function name and other adds a new argument. It will merge it without conflicts. It still has some troubles to solve complex issues, without knowing author intensions. But can significantly simplify developers' lives. Not sure if it would land into git very soon. It requires all git to know all the parsers you need. But definitely worth adding.

    • Velocifyer 10 days ago ago

      This is a seprate tool that one can tell git to use.

  • mnemonet 2 hours ago ago

    This is a very interesting idea that could save a lot of time and pain in big projects.

    The example shown reminds me pf Zed's CRDTs [1], and their journey to build a fine-grained version control system for agentic development [2]—I imagine this work could prove useful to the Zed/Cursor team, and likely shares a lot of functionality with DeltaDB [2].

    - [1]: https://zed.dev/blog/crdts

    - [2]: https://zed.dev/blog/sequoia-backs-zed

    • vinnyhaps 24 minutes ago ago

      I’m pretty sure one of the Zed founders wrote tree-sitter, so I’m sure there’s some overlap

      It’s really cool to see tree-sitter unlock so many of these use cases. I love using [difftastic] for my diffing tool to get context aware diffs. So in the example from the article, the diff would highlight the `void` and `int` changes with a heavier background of red and green respectively

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