feat: 新增 Git credential helper 协议支持,实现 get|store|erase 子命令

This commit is contained in:
2026-07-16 11:38:06 +08:00
parent b6bc091502
commit 19aff8a6c1
4 changed files with 134 additions and 3 deletions

View File

@@ -9,6 +9,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
暂无。
## [0.4.0] - 2026-07-16
### ✨ 新功能
- 新增 `quicommit credential get|store|erase` 子命令,实现标准 Git credential helper 协议([gitcredentials](https://git-scm.com/docs/gitcredentials)),可与原生 `git` 命令无缝集成
- 新增 `host_to_service()` 主机名映射,将 github.com、gitlab.com、bitbucket.org 等常见托管平台映射为规范化服务名
- 新增 `get_pat_for_host()` 公共 API支持从已保存的凭据中提取 PAT 用于登录验证
- 凭据存储复用现有基于系统密钥环的 PAT 与用户绑定逻辑,按 profile 维度管理
### 🐞 错误修复
- 移除 `keyring.rs` 中的调试 `eprintln!` 输出,避免污染 credential helper 的 stderr
### 📚 文档
- README中/英文)新增 credential 命令使用说明
### 🔧 其他变更
- 新增 `src/lib.rs` 库目标,支持从 `tests/` 目录导入内部模块进行测试
- `src/main.rs` 重构为使用 `quicommit::` 库导入
- credential 命令及其子命令均使用 `#[command(hide = true)]` 隐藏,不在 `--help` 中显示
- 新增 `tests/credential_tests.rs`,包含 52 个测试用例覆盖协议解析、帮助可见性、完整存取周期及边界场景
## [0.3.1] - 2026-06-01
### ✨ 新功能