Skip to content

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Jan 16, 2026

在 amend 模式下新增两个功能:

  1. 将原 commit msg 作为参考传递给 AI,一般amend的时候不需要再跟-m来指定额外提示词
  2. 保留原提交中的 Change-Id(如果存在)

  1. Added extract_change_id function to parse Change-Id from existing commit messages
  2. Added append_change_id function to add Change-Id to new commit messages when not present
  3. Modified build_prompt to accept original commit message parameter for reference in amend mode
  4. Updated generate_commit_message to extract original Change-Id in amend mode and preserve it in new commit message
  5. Added original commit message to AI prompt for better context in amend mode
  6. Added comprehensive unit tests for Change-Id extraction and appending functions

Log: Improved commit message generation in amend mode to preserve Change-Id and reference original message

Influence:

  1. Test amend mode with existing Change-Id to ensure it's preserved
  2. Test amend mode without Change-Id to ensure no extra Change-Id is added
  3. Verify AI generates improved commit messages while referencing original content
  4. Test Change-Id extraction with various message formats
  5. Verify Change-Id appending logic handles edge cases properly
  6. Test commit message generation with and without other metadata tags

feat: 在 amend 模式下保留 Change-Id

  1. 添加 extract_change_id 函数从现有提交消息中解析 Change-Id
  2. 添加 append_change_id 函数在提交消息不存在 Change-Id 时添加
  3. 修改 build_prompt 函数以接受原始提交消息参数,用于 amend 模式下的参考
  4. 更新 generate_commit_message 函数在 amend 模式下提取原始 Change-Id 并 保留到新提交消息中
  5. 将原始提交消息添加到 AI 提示词中,为 amend 模式提供更好的上下文
  6. 添加全面的单元测试,覆盖 Change-Id 提取和添加功能

Log: 改进 amend 模式下的提交消息生成,保留 Change-Id 并参考原始消息

Influence:

  1. 测试带有现有 Change-Id 的 amend 模式,确保 Change-Id 被保留
  2. 测试没有 Change-Id 的 amend 模式,确保不会添加额外的 Change-Id
  3. 验证 AI 在参考原始内容的同时生成改进的提交消息
  4. 测试不同消息格式下的 Change-Id 提取功能
  5. 验证 Change-Id 添加逻辑正确处理边界情况
  6. 测试带有和不带有其他元数据标签的提交消息生成

1. Added extract_change_id function to parse Change-Id from existing
commit messages
2. Added append_change_id function to add Change-Id to new commit
messages when not present
3. Modified build_prompt to accept original commit message parameter for
reference in amend mode
4. Updated generate_commit_message to extract original Change-Id in
amend mode and preserve it in new commit message
5. Added original commit message to AI prompt for better context in
amend mode
6. Added comprehensive unit tests for Change-Id extraction and appending
functions

Log: Improved commit message generation in amend mode to preserve
Change-Id and reference original message

Influence:
1. Test amend mode with existing Change-Id to ensure it's preserved
2. Test amend mode without Change-Id to ensure no extra Change-Id is
added
3. Verify AI generates improved commit messages while referencing
original content
4. Test Change-Id extraction with various message formats
5. Verify Change-Id appending logic handles edge cases properly
6. Test commit message generation with and without other metadata tags

feat: 在 amend 模式下保留 Change-Id

1. 添加 extract_change_id 函数从现有提交消息中解析 Change-Id
2. 添加 append_change_id 函数在提交消息不存在 Change-Id 时添加
3. 修改 build_prompt 函数以接受原始提交消息参数,用于 amend 模式下的参考
4. 更新 generate_commit_message 函数在 amend 模式下提取原始 Change-Id 并
保留到新提交消息中
5. 将原始提交消息添加到 AI 提示词中,为 amend 模式提供更好的上下文
6. 添加全面的单元测试,覆盖 Change-Id 提取和添加功能

Log: 改进 amend 模式下的提交消息生成,保留 Change-Id 并参考原始消息

Influence:
1. 测试带有现有 Change-Id 的 amend 模式,确保 Change-Id 被保留
2. 测试没有 Change-Id 的 amend 模式,确保不会添加额外的 Change-Id
3. 验证 AI 在参考原始内容的同时生成改进的提交消息
4. 测试不同消息格式下的 Change-Id 提取功能
5. 验证 Change-Id 添加逻辑正确处理边界情况
6. 测试带有和不带有其他元数据标签的提交消息生成
@mhduiy mhduiy marked this pull request as draft January 16, 2026 07:36
@mhduiy mhduiy marked this pull request as ready for review January 16, 2026 07:40
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.

1 participant