fix: preserve all commit marks (Fixes/PMS/Log/etc.) when using --amend#19
Merged
fix: preserve all commit marks (Fixes/PMS/Log/etc.) when using --amend#19
Conversation
When using `git-commit-helper commit --amend`, issue references (Fixes: and PMS:) from the original commit were being lost because the AI-generated message didn't always include them. Now, when --amend is used without explicitly providing new --issues, the tool extracts Fixes: and PMS: marks from the original commit message and appends any missing ones to the new commit message. The Change-Id preservation logic already existed and is unchanged. Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix git-commit-helper to preserve issue associations on amend
fix: preserve Fixes:/PMS: issue references when using --amend
Feb 25, 2026
zccrs
requested changes
Feb 25, 2026
… issue refs Expand the amend mark preservation from only Fixes:/PMS: to all marks from the original commit (excluding Change-Id which is already handled by append_change_id). This ensures Log:, Fixes:, PMS:, and any other single-line marks are retained when amending a commit. Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>
Copilot
AI
changed the title
fix: preserve Fixes:/PMS: issue references when using --amend
fix: preserve all commit marks (Fixes/PMS/Log/etc.) when using --amend
Feb 25, 2026
zccrs
requested changes
Feb 25, 2026
Separate the mark preservation logic from the --issues parameter check.
Instead of nesting in `else if amend`, use a standalone `if amend { ... }`
block that handles all amend-specific mark preservation (including
Change-Id) in one place, after the --issues handling.
Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>
zccrs
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
commit --amendlosesFixes:andPMS:issue references from the original commit--amendmode (excludingChange-Id:which is already handled separately byappend_change_id)Fixes:,PMS:,Log:, and any other single-line mark fields--issuesexplicitly still overrides the preserved referencesif amend { ... }block (separate from the--issueshandling), consolidating both mark preservation and Change-Id into one placeOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.