Weave:基于语言结构而非行数的合并
Weave: Merging based on language structure and not lines

原始链接: https://ataraxy-labs.github.io/weave/

**Weave** 是一款用于 Git 的实体级语义合并驱动程序,旨在消除不必要的合并冲突。与依赖于行级比较的标准 Git 不同,Weave 使用 `tree-sitter` 来解析代码结构。这使其能够智能地在函数和类级别合并更改,从而确保同一文件不同部分的编辑可以自动集成,无需人工干预。 主要功能包括: * **语义合并:** 当多个智能体或开发人员修改同一文件中的不同实体时,防止冲突发生。 * **协同机制:** 为多智能体工作流程提供可选的基于 CRDT 的层,以便在冲突发生前预先声明实体,从而避免冲突。 * **广泛的兼容性:** 支持 28 种语言(包括 Python、Go、Rust 和 TypeScript)及 5 种数据格式。 * **AI 集成:** 内置 MCP 服务器,使 Claude 等 AI 智能体能够直接与代码库进行交互。 Weave 已通过超过 4,900 次文件合并测试且零回归,旨在简化现代 AI 辅助开发流程。安装简单:通过 Homebrew 安装并运行 `weave setup` 即可配置 Git。请访问完整文档,了解如何将其替换为您现有的行级合并策略。

抱歉。
相关文章

原文

Entity-level semantic merge driver for Git. Two agents edit different functions in the same file? Clean merge. Every time.

# Two agents edited different functions

$ git merge feature-b
CONFLICT (content): Merge conflict in src/lib.ts
Automatic merge failed.

# Git sees overlapping lines.
# The functions don't actually overlap.
# Same merge, with weave configured

$ git merge feature-b
weave [src/lib.ts]:
  2 entities matched, 2 modified, 0 conflicts
Merge made by the 'ort' strategy.

# Different functions = no conflict.

copied $ brew install weave

31 out of 31.

31 merge scenarios across 7 languages. Full breakdown →

83 real-world wins

0 regressions on C, Python, Go

4,917 file merges tested

1,500+ downloads

Three layers

Use just the merge driver. Or add coordination for multi-agent workflows. Full docs →

MERGE

Merge Driver

Replaces git's line-level merge. Parses code with tree-sitter, merges by function and class.

COORDINATE

CRDT State

Agents claim entities before editing. Detect conflicts before they happen.

CONNECT

MCP Server

15 tools via Model Context Protocol. Claude and other AI agents call them directly.

28 languages

Entity extraction powered by sem-core and tree-sitter. Plus 5 data formats. Full list →

TypeScript JavaScript Python Go Rust Java C C++ C# Ruby PHP Swift Kotlin Elixir Bash HCL Fortran Dart Perl OCaml Scala Zig Vue Svelte XML ERB JSON YAML TOML CSV Markdown

Try it. 5 seconds.

$ brew install weave

$ cd my-project && weave setup
 Merge driver configured

$ git merge feature-branch
Merge made by the 'ort' strategy.
联系我们 contact @ memedata.com