Replies: 2 comments 3 replies
|
Right now, I believe we only support this type of tool as a merge tool for You can also see all of the built-in merge tool configuration here (including Mergiraf): https://github.com/jj-vcs/jj/blob/main/cli/src/config/merge_tools.toml I believe we didn't initially plan too deeply for structured merge tools actually, it's more than we already had interactive merge tools, and it seemed like it would be useful to support Mergiraf, so we just added some additional config options to support non-interactive merge tools as well (e.g. parsing Git diff3-style conflict markers to allow partial conflict resolution and allowing different exit codes to indicate conflicts). We use a similar interface to Git merge drivers right now, so it's nothing too unique IMO. Some current issues that may be relevant are:
Hopefully we can solve these in the future. I think people have also talked about using merge tools automatically to resolve conflicts when merging/rebasing, but I'm not sure how feasible that would be. |
|
just wanted to register my interest in having weave as a readily usable tool out of the box; this seemed like a better place than #8833 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The Mergiraf integration in jj is great to see, it's a clear signal that the project values structured merge over Git's line-based approach. I've been working on a merge driver called weave that takes a different but complementary approach, and I wanted to ask about the integration path for additional structured merge tools via
jj resolve --toolor the merge driver configuration.Where Mergiraf operates on AST nodes (syntax-level merging), weave operates on semantic entities, functions, classes, methods, and imports extracted via tree-sitter. The practical difference shows up in a few places: class members merge as unordered sets (so two branches adding different methods to the same class merge cleanly regardless of insertion point), imports merge as sets rather than ordered lines, and entity renames are detected via structural content hashing. On a benchmark of 31 merge scenarios, weave resolves all 31 cleanly versus Git's 15/31. Mergiraf's AST approach has its own strengths, finer-grained handling of expression-level changes, for instance, so these feel like complementary tools rather than competing ones. The underlying extraction library (sem-core) supports 11 languages and is available as a Rust crate.
Is there a recommended path for integrating external merge tools beyond Mergiraf? I'm curious whether
jj resolve --toolis the right entry point, or if there's a more structured merge driver interface that jj exposes. Also interested in whether the team has thoughts on the trade-offs between syntax-level and entity-level structured merge, the Mergiraf integration suggests you've already thought deeply about this space.All reactions