Repository navigation
git-rg v0.4.1
git-rg v0.4.1
v0.4.1 fixes automatic GitLab authentication when a token stored by glab has spaces or tabs around it. Thanks to @coanor for PR #1.
English
GitLab credential fix
A padded token could work with glab auth status and glab api while git-rg rejected it, emitted auth_unavailable, and fell back to anonymous access. Private or internal repositories could then return HTTP 404.
- Trim leading and trailing ASCII spaces and tabs from the GitLab helper password before validating the access token. This applies to both PAT and OAuth credentials.
- Continue rejecting embedded whitespace, control bytes, invalid UTF-8, empty credentials, CI job tokens, and conflicting credential fields.
- Stored credentials, environment-token priority,
--auth auto/--auth env, CLI exit codes, and NDJSON schema v1 remain unchanged. No migration is required; upgrade the binary to v0.4.1.
Verification and assets
The PR passed go test -race ./..., go vet ./..., and go build ./... on OrbStack Linux arm64 with Go 1.26.0. Regression coverage exercises credential resolution with padded PAT/OAuth tokens, CRLF helper output, capability fields, and invalid tokens. The contributor also reported a successful macOS arm64 run against an internal GitLab repository with glab 1.115.0 and a real padded PAT; that private-instance check was not independently repeated for this release.
The release provides Linux, macOS, and Windows archives for amd64 and arm64, plus install.sh, install.ps1, and checksums.txt (nine assets). Checksums cover all six archives and both installers. Native build and installation smoke results are available in the Release workflow. See the installation guide for installation and rollback.
中文
GitLab 凭证修复
当 glab 保存的 token 两端带有空格或制表符时,glab auth status 和 glab api 可能正常工作,但 git-rg 会拒绝该凭证、发出 auth_unavailable 并回退为匿名访问,导致私有或 internal 仓库返回 HTTP 404。
- 校验前移除 GitLab helper password 两端的 ASCII 空格和制表符,同时支持 PAT 和 OAuth access token。
- 仍拒绝内部空白、控制字符、无效 UTF-8、空凭证、CI job token 和冲突的凭证字段。
- 已保存的凭证、环境变量 token 优先级、
--auth auto/--auth env、CLI 退出码及 NDJSON schema v1 均保持不变。无需迁移,升级二进制到 v0.4.1 即可。
验证与发布资产
已在 OrbStack Linux arm64、Go 1.26.0 上验证此 PR,通过 go test -race ./...、go vet ./... 和 go build ./...。回归测试覆盖带空白的 PAT/OAuth token、CRLF helper 输出、capability 字段和无效 token。贡献者另报告在 macOS arm64、glab 1.115.0 上使用真实带空白 PAT 成功访问 internal GitLab 仓库;本次发布未独立复验该私有实例。
Release 包含 Linux、macOS、Windows 的 amd64/arm64 六个 archive,以及 install.sh、install.ps1 和 checksums.txt,共九个资产。checksum 覆盖六个 archive 和两个安装器。原生构建与安装 smoke 结果见 Release workflow,安装及回滚步骤见安装文档。
完整变更记录 / Full changelog: v0.4.0...v0.4.1