
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 分