Skip to content

Release v0.13.7

CLI Amend 模式 - AI 驱动的 --amend 提交消息重新生成

新增

gcop-rs commit --amend

  • commit 命令新增 --amend 选项,使用 AI 重新生成最近一次提交的消息
  • 通过 get_commit_diff("HEAD") 读取 HEAD 提交的 diff;如果有额外的暂存更改,合并两者后发送给 LLM
  • 确认后执行 git commit --amend -m <message>
  • 兼容所有现有模式:--dry-run--json-y、交互菜单(接受 / 编辑 / 重试 / 退出)

commit_amend() Trait 方法

  • GitOperations trait 新增 commit_amend(&self, message: &str) 方法
  • 使用 git CLI(而非 git2)以保留 GPG 签名和 hook 支持

变更

Diff 获取逻辑重构

  • 提取 get_diff(repo, amend) 辅助函数,统一交互模式和 JSON 模式的 amend/normal diff 获取逻辑,消除重复代码

校验增强

  • --amend --split 同时使用时报错提示
  • 空仓库(无提交)使用 --amend 时提前返回并给出引导

升级

bash
# Homebrew
brew upgrade gcop-rs

# Cargo
cargo install gcop-rs

# pip
pip install --upgrade gcop-rs