Repository navigation
git-rg v0.5.0
git-rg v0.5.0
Agent-authored changes and draft GitHub PRs / GitLab MRs without cloning. Remote writes remain off by default.
English
Read, preview, and propose
git-rg readreturns the complete UTF-8 file, immutable commit SHA, blob SHA, and file mode, with downloaded bytes verified against the blob ID.git-rg propose --dry-run --changes changes.jsonvalidates a plan and emits a unified diff using read-only requests.git-rg propose --enable-write --changes changes.jsoncreates one commit on a new same-repository branch and a draft PR/MR. Each invocation requires a separateGITRG_WRITE_TOKEN; an existing read credential or a token alone cannot enable writes.- Optional
--agent-name,--agent-model, and--agent-run-idflags, or anagentobject in the plan, add self-reported attribution to the description. The authenticated platform author remains the token's account.
Conflict checks and recovery
Publication checks the pinned base, expected file blobs, source branch, commit parent, and complete resulting tree. It never updates an unrelated existing branch. Identical plans and agent identities can recover a matching commit or PR/MR after an uncertain response. Write requests are neither automatically retried nor redirected. result.complete describes publication only, not test or CI success.
The command supports up to 100 regular text-file changes, 1 MiB per file, and 4 MiB each for original and replacement content. Binary/LFS edits, symlinks, submodules, fork PRs, existing-branch updates, automatic merging, and executing repository code are outside this release's scope.
Boundary fixes
- Apply GitLab deletions before additions, allowing a directory to be replaced with a file while preserving recovery fingerprints.
- Include stdin and change-plan reading in the overall timeout, even when the producer has not closed the pipe.
- Quote Unicode filenames using Git-compatible byte escapes, so the emitted preview can be applied by Git.
Upgrade and validation
Existing search/ref commands, automatic read authentication, exit codes, and NDJSON schema v1 remain compatible. Read-only users need no migration. See Agent changes for the plan schema, identity parameters, limits, and recovery examples.
Local validation used OrbStack Linux arm64 with Go 1.26: full race tests, vet, and build. Regression tests cover timeout handling, actual git apply of Unicode diffs, both providers' publication/recovery flows through HTTP fixtures, default-disabled writes, and identity propagation. Live provider smoke checks exercise read-only paths; live commit/PR/MR writes are not certified by those fixtures.
The Release workflow builds and checks six native binaries (Linux/macOS/Windows, amd64/arm64), then verifies installation and public-provider smoke paths. Assets include six archives, two installers, and checksums.txt. See Installation.
中文
读取、预览与创建提案
git-rg read返回完整 UTF-8 文本、固定 commit SHA、blob SHA 和文件模式,并核验下载内容的 blob ID。git-rg propose --dry-run --changes changes.json只读校验变更计划并输出 unified diff。git-rg propose --enable-write --changes changes.json在同仓库的新分支创建一个 commit 和草稿 PR/MR。写入默认关闭,每次必须显式启用并提供独立的GITRG_WRITE_TOKEN,不会复用读取凭证进行写入。- 可通过
--agent-name、--agent-model、--agent-run-id或计划中的agent对象,在描述中附加 Agent 自报身份。平台作者仍为 Token 对应账号。
冲突检查与失败恢复
发布会检查固定基线、预期文件 blob、源分支、commit parent 和完整结果 tree,不覆盖无关的已有分支。响应不确定时,相同计划及身份可以恢复匹配的 commit 或 PR/MR。写入请求不自动重试、不跟随重定向;result.complete 只表示提案发布完成,不代表测试或 CI 通过。
最多支持 100 个普通文本文件变更、每文件 1 MiB、原内容与新内容各 4 MiB。本版不支持编辑二进制/LFS、symlink、submodule、fork PR、更新已有分支、自动合并或执行仓库代码。
边界修复
- GitLab 先执行删除,再执行添加,支持把目录替换为文件,并保留原有恢复指纹。
- stdin 和变更计划读取纳入整体超时,上游未关闭管道时也能退出。
- Unicode 文件名使用 Git 兼容的字节转义,预览 diff 可由 Git 正确应用。
升级与验证
已有搜索/ref 命令、自动读取认证、退出码及 NDJSON schema v1 保持兼容,只读用户无需迁移。计划格式、身份参数、限制和恢复示例见变更提案文档。
本地在 OrbStack Linux arm64、Go 1.26 中通过全量 race 测试、vet 和构建。回归覆盖输入超时、Unicode diff 的实际 git apply、两个 provider 的 HTTP 模拟发布/恢复、默认禁止写入和身份传递。真实服务 smoke 验证只读路径;HTTP 模拟测试不等于真实远端 commit/PR/MR 写入验收。
Release workflow 构建并检查 Linux/macOS/Windows 的 amd64/arm64 六个原生二进制,再执行安装与公开仓库 smoke。发布资产为六个 archive、两个安装脚本和 checksums.txt,安装与回滚方式见安装文档。
完整变更记录 / Full changelog: v0.4.1...v0.5.0