feat(core,engine): split smart merge strategy into prefer-main / prefer-branch
The single "smart" strategy is now two flavors with the new default flipped to prefer-main. Both share a pre-cascade `git fetch origin <currentBranch>` + best-effort fast-forward so a freshly-pushed sibling commit doesn't get clobbered when the fallback resolves a conflict against a stale base. - "smart-prefer-main" (new default): -X ours fallback. Protects just-merged sibling work from being regressed by a concurrent task branch. - "smart-prefer-branch": -X theirs fallback. Equivalent to legacy "smart". Legacy "smart" / "prefer-main" enum values are accepted and normalized via `normalizeMergeConflictStrategy()` so existing settings.json files migrate seamlessly. The fast-forward step gracefully degrades on fetch failure or divergent local main (logs and continues). Updates settings UI dropdown, test helpers, and adds 5 fetch+ff regression tests + 7 normalize-helper tests. Lint cleanup of two empty catch blocks in scripts/release.mjs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -193,7 +193,7 @@ function computeReleasePlan() {
|
||||
fail(`Failed to compute release plan:\n${r.stderr || r.stdout}`);
|
||||
}
|
||||
const plan = JSON.parse(readFileSync(out, "utf8"));
|
||||
try { unlinkSync(out); } catch {}
|
||||
try { unlinkSync(out); } catch { /* tmp cleanup is best-effort */ }
|
||||
|
||||
const bumpedReleases = (plan.releases || []).filter((rel) => rel.type !== "none");
|
||||
if (bumpedReleases.length === 0) {
|
||||
@@ -290,7 +290,7 @@ function findPackageDir(name) {
|
||||
try {
|
||||
const pkg = JSON.parse(readFileSync(p, "utf8"));
|
||||
if (pkg.name === name) return join(root, entry);
|
||||
} catch {}
|
||||
} catch { /* skip unreadable/broken package.json */ }
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user