
mergelock
io.github.sadayamuthu由 GitHub 账号 sadayamuthu 发布v0.1.5更新于 Oct 24, 2026
Finds merge conflicts git can't see between branches: changed signatures vs new callers.
概览
一个 git 原生的合并门禁,能发现 git 看不到的冲突(如签名变更与新增调用不匹配),并通过 MCP 提供给 AI 助手使用。
- 可以做什么
- 在分支合并前比较两个分支,报告 git 不会提示的语义冲突
- 检测一侧改了函数签名而另一侧新增了旧签名的调用、一侧删除的符号仍被另一侧使用、同一函数被写了两遍
- 标记普通文本冲突、两个分支在同一路径新增文件、以及一方修改另一方删除的碰撞
- 对 TypeScript、JavaScript(含 TSX/JSX)和 Python 做语义分析,其他语言仍做文本类检查
- 输出带严重级别的结果和便于脚本、钩子与 CI 使用的退出码
- 适用场景
- 适合 AI 编码助手在将要合并的分支上工作时使用,让它在合并前发现跨分支的破坏,例如在 pre-push 钩子、CI 任务或审查并行分支时。
- 运行要求
- 以本地 stdio 进程运行;清单提供 OCI 镜像(ghcr.io/sadayamuthu/mergelock:0.1.5),需挂载仓库,也可通过 Homebrew、deb/rpm、预编译二进制或 Go 1.25+ 加 C 编译器安装。需要 git 2.38 或更新版本以及一个 git 仓库。未声明认证或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 mergelock,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mergelock
[CI] [Release] [Homebrew] [Docker] [deb/rpm] [MCP Registry] [Glama] [License]
A git-native merge gate. mergelock check compares two branches before
they meet and reports the conflicts git itself won't tell you about: a
function whose signature changed on one branch while the other branch
added calls to the old signature, a symbol deleted on one side but still
used on the other, the same function written twice.
It never touches your working tree. Everything is computed from commits
with git merge-tree and tree-sitter parsers, so it is safe to run in a
pre-push hook, in CI, or from an AI coding agent over MCP.
What it detects
Semantic rules understand TypeScript, JavaScript (incl. TSX/JSX) and Python. Files in other languages still get the textual, add/add and modify/delete checks.
Install
mergelock needs git 2.38 or newer (for git merge-tree --write-tree).
Homebrew (macOS and Linux):
Debian / Ubuntu (.deb, amd64 and arm64; needs a distribution with git
2.38+, such as Debian 12 or Ubuntu 24.04):
Fedora / RHEL (.rpm, x86_64 and aarch64):
Docker (linux/amd64 and linux/arm64; mount the repository at /repo):
GitHub Actions (checks each pull request against its base branch; see In CI):
Prebuilt binary (macOS and Linux, amd64 and arm64): download the archive
for your platform from the
latest release,
then put mergelock on your PATH:
On macOS, a binary from an archive downloaded in a browser is blocked by Gatekeeper because it isn't signed yet (Homebrew installs aren't affected). Clear the quarantine flag once:
With Go (needs Go 1.25 or newer and a C compiler, since cgo is used for
tree-sitter; on macOS install the Xcode command-line tools, on
Debian/Ubuntu build-essential):
Or build from source:
Check it works:
Quick start
Run inside any git repository:
Exit codes make it easy to script:
See USAGE.md for the full command reference, the
.mergelock.yml config, the JSON output schema, CI and git-hook recipes,
and how to connect it to an AI agent over MCP.
To report a missed conflict or add a language, see
CONTRIBUTING.md; for a security problem, see
SECURITY.md.
Development
Rule behaviour is pinned by branch-pair fixtures in testdata/fixtures/*.txtar;
each one is a tiny repo with a base, two branches and the expected findings.
License
来源:README.md,提交 c816d3c
工具
0版本历史
3- v0.1.5最新Oct 17, 2026
- v0.1.4Oct 16, 2026
- v0.1.3Oct 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分