Commit 1bfaea9
fix: preserve all commit marks (Fixes/PMS/Log/etc.) when using --amend (#19)
* Initial plan
* fix: preserve Fixes:/PMS: issue references in --amend mode
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>
* fix: preserve all marks (Fixes/PMS/Log/etc) in --amend mode, not just 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>
* refactor: move amend mark preservation into a dedicated if amend block
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>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>1 parent 5b28e51 commit 1bfaea9
1 file changed
+91
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
882 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
883 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
884 | 905 | | |
885 | 906 | | |
886 | 907 | | |
| |||
1154 | 1175 | | |
1155 | 1176 | | |
1156 | 1177 | | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1157 | 1246 | | |
0 commit comments