@unifan/pi-commit-zh 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -2
- package/package.json +1 -1
- package/src/git.ts +6 -17
package/index.ts
CHANGED
|
@@ -132,7 +132,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
132
132
|
});
|
|
133
133
|
} else {
|
|
134
134
|
if (pushRes.hasConflict) {
|
|
135
|
-
notify("⚠️
|
|
135
|
+
notify("⚠️ 远端变基冲突:请对比修改与上下文解决冲突,严禁直接使用 ours/theirs。", "warning");
|
|
136
136
|
} else {
|
|
137
137
|
notify(`⚠️ 推送失败: ${pushRes.output}`, "error");
|
|
138
138
|
}
|
|
@@ -182,7 +182,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
182
182
|
pushText = `\n\n${successMsg}`;
|
|
183
183
|
} else {
|
|
184
184
|
if (pushRes.hasConflict) {
|
|
185
|
-
notify("⚠️
|
|
185
|
+
notify("⚠️ 远端变基冲突:请对比修改与上下文解决冲突,严禁直接使用 ours/theirs。", "warning");
|
|
186
186
|
} else {
|
|
187
187
|
notify(`⚠️ 推送失败: ${pushRes.output}`, "error");
|
|
188
188
|
}
|
package/package.json
CHANGED
package/src/git.ts
CHANGED
|
@@ -129,23 +129,12 @@ export async function pushCurrentBranch(
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
const filesListText = conflictFiles.length > 0
|
|
132
|
-
? `\n
|
|
133
|
-
: "";
|
|
134
|
-
|
|
135
|
-
const conflictOutput = `⚠️
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
1. **严禁直接无脑使用 \`--theirs\` 或 \`--ours\`**:绝对不要盲目使用其中一方覆盖另一方,否则极易覆盖远端同事的代码或丢失本地修复!
|
|
139
|
-
2. **必须根据对比修改和上下文解决冲突**:
|
|
140
|
-
- 逐个打开冲突文件,对照 \`<<<<<<< HEAD\`(远端基线)与 \`>>>>>>>\`(本地提交)的具体改动;
|
|
141
|
-
- 结合周围类、函数、接口调用与业务上下文,理解两边的意图后逐行融合成正确的最终代码。
|
|
142
|
-
|
|
143
|
-
🛠️ **解决冲突操作步骤**:
|
|
144
|
-
1. 对比并手工/智能修改上述冲突文件,消除所有冲突标记;
|
|
145
|
-
2. 执行 \`git add <已解决文件>\` 标记冲突已解决;
|
|
146
|
-
3. 执行 \`git rebase --continue\` 完成变基;
|
|
147
|
-
4. 变基成功后重新执行 \`/commit-push\` 推送至远端;
|
|
148
|
-
(若需放弃本次变基恢复原状,可执行 \`git rebase --abort\`)。\n\n底层详细输出:\n${rebaseErr}`;
|
|
132
|
+
? `\n${conflictFiles.map((f) => `- \`${f}\``).join("\n")}\n`
|
|
133
|
+
: "\n";
|
|
134
|
+
|
|
135
|
+
const conflictOutput = `⚠️ **远端变基拉取存在代码冲突**:${filesListText}
|
|
136
|
+
- **解决原则**:严禁直接使用 theirs 或 ours 覆盖,必须根据双方修改对比与代码上下文解决冲突。
|
|
137
|
+
- **后续步骤**:解决冲突 ➔ \`git add <文件>\` ➔ \`git rebase --continue\` ➔ 再次执行 \`/commit-push\`(放弃可 \`git rebase --abort\`)。\n\nGit 输出:\n${rebaseErr}`;
|
|
149
138
|
|
|
150
139
|
return {
|
|
151
140
|
ok: false,
|