Hacker News new | ask | show | jobs
by afiori 81 days ago
being able to customize the chunking/diffing process with something analogous to an lsp would greatly improve this. In my experience a particularly horribly handled case is when eg two branches add two distinct methods/functions in the same file location (especially if there is some boilerplate so that the two blocks share more than a few lines).

a language aware merge could instead produce

>>>> function foo(){ ... } ===== function bar(){ ... } <<<<<<

1 comments

If you haven't heard of it yet, Mergiraf uses tree-sitter grammars to resolve merges using syntax-aware logic and has a pretty good success rate for my work.