Skip to content

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Sep 28, 2025

  1. Added --amend flag to modify the last commit instead of creating a new one
  2. Implemented logic to fetch diff from last commit when in amend mode
  3. Added display of original commit message for reference during amend
  4. Modified git command execution to include --amend flag when appropriate
  5. Added proper error handling for amend mode when no commit history exists
  6. Updated help documentation to include the new --amend option
  7. Skip AI code review for amend operations since it's modifying existing commit

Log: Added --amend option to modify last commit with new commit message

Influence:

  1. Test normal commit functionality to ensure no regression
  2. Test --amend option with staged changes to modify last commit
  3. Test --amend option with other flags like --only-chinese
  4. Verify error handling when no commit history exists for amend
  5. Test amend with different commit types and messages
  6. Verify that original commit message is displayed correctly
  7. Ensure AI code review is skipped for amend operations

feat: 为 commit 命令添加 --amend 选项

  1. 添加 --amend 标志用于修改上一次提交而不是创建新提交
  2. 实现在 amend 模式下从上次提交获取差异内容的逻辑
  3. 添加在 amend 时显示原提交信息供参考的功能
  4. 修改 git 命令执行以在适当时包含 --amend 标志
  5. 为 amend 模式添加适当的错误处理,当没有提交历史时
  6. 更新帮助文档以包含新的 --amend 选项
  7. 为 amend 操作跳过 AI 代码审查,因为是修改现有提交

Log: 新增 --amend 选项用于使用新提交信息修改上次提交

Influence:

  1. 测试正常提交功能以确保没有回归
  2. 测试 --amend 选项与暂存更改一起使用来修改上次提交
  3. 测试 --amend 选项与其他标志如 --only-chinese 的组合使用
  4. 验证当没有提交历史时 amend 的错误处理
  5. 测试使用不同提交类型和消息的 amend 操作
  6. 验证原提交信息是否正确显示
  7. 确保 AI 代码审查在 amend 操作中被跳过

1. Added --amend flag to modify the last commit instead of creating a
new one
2. Implemented logic to fetch diff from last commit when in amend mode
3. Added display of original commit message for reference during amend
4. Modified git command execution to include --amend flag when
appropriate
5. Added proper error handling for amend mode when no commit history
exists
6. Updated help documentation to include the new --amend option
7. Skip AI code review for amend operations since it's modifying
existing commit

Log: Added --amend option to modify last commit with new commit message

Influence:
1. Test normal commit functionality to ensure no regression
2. Test --amend option with staged changes to modify last commit
3. Test --amend option with other flags like --only-chinese
4. Verify error handling when no commit history exists for amend
5. Test amend with different commit types and messages
6. Verify that original commit message is displayed correctly
7. Ensure AI code review is skipped for amend operations

feat: 为 commit 命令添加 --amend 选项

1. 添加 --amend 标志用于修改上一次提交而不是创建新提交
2. 实现在 amend 模式下从上次提交获取差异内容的逻辑
3. 添加在 amend 时显示原提交信息供参考的功能
4. 修改 git 命令执行以在适当时包含 --amend 标志
5. 为 amend 模式添加适当的错误处理,当没有提交历史时
6. 更新帮助文档以包含新的 --amend 选项
7. 为 amend 操作跳过 AI 代码审查,因为是修改现有提交

Log: 新增 --amend 选项用于使用新提交信息修改上次提交

Influence:
1. 测试正常提交功能以确保没有回归
2. 测试 --amend 选项与暂存更改一起使用来修改上次提交
3. 测试 --amend 选项与其他标志如 --only-chinese 的组合使用
4. 验证当没有提交历史时 amend 的错误处理
5. 测试使用不同提交类型和消息的 amend 操作
6. 验证原提交信息是否正确显示
7. 确保 AI 代码审查在 amend 操作中被跳过
@mhduiy mhduiy marked this pull request as draft September 29, 2025 01:34
@mhduiy mhduiy marked this pull request as ready for review September 29, 2025 01:34
@zccrs zccrs requested a review from Copilot October 11, 2025 08:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an --amend option to the commit command, allowing users to modify the last commit instead of creating a new one. The feature includes proper diff handling from the previous commit, displays the original commit message for reference, and skips AI code review for amend operations.

  • Added --amend flag parameter to commit command structure and function signatures
  • Implemented logic to fetch diff from last commit when in amend mode with proper error handling
  • Modified commit execution to include --amend flag and updated user prompts for amend context

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/main.rs Added amend parameter to commit command definition and function call
src/git.rs Added helper functions to get last commit diff and message for amend mode
src/commit.rs Implemented amend logic with conditional diff handling, UI updates, and git command modification
README.md Updated documentation to include the new --amend option and usage examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zccrs zccrs merged commit d0d479e into zccrs:master Oct 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants