Skip to content

fix(sync): detect previous-cut files by content, not by commit - #111

Merged
tomorrowflow merged 1 commit into
mainfrom
fix/sync-merge-squashed-cut
Oct 19, 2026
Merged

tomorrowflow merged 1 commit into
mainfrom
fix/sync-merge-squashed-cut

Conversation

@tomorrowflow

Copy link
Copy Markdown
Owner

Problem

scripts/sync-merge-release.mjs takes the release side for a conflict only when no fork commit touched the file. The 2026.10.5 sync landed as a squash commit (#57). That commit touches every file 10.5 changed, so every file from that cut looks like fork work. A trial merge of release/2026.10.10 caught only 4 files with the previous-release-cut rule and left 410 conflicts for the sync agent.

Solution

  • The script now decides "fork-changed" by content: it diffs main against the newest upstream release commit main already contains (the latest merge base across upstream/release/*; 1808b57b75f today).
  • When the target release deleted such an unchanged file, the script takes the deletion. Before, checkout --theirs crashed on these.

Evidence

  • Trial merge of release/2026.10.10 in a throwaway worktree: previous-release-cut 4 → 345, conflicts left 410 → 69. The 69 are the 67 files with real fork changes since 10.5, plus the 2 interim CHANGELOG/2026.10.2*.md files the fork carries as add/add.
  • pnpm test test/scripts/sync-merge-release.test.ts --maxWorkers=1: 5/5 pass, about 1.7s. The new squash-cut test, including the release-deleted case, failed before the fix (expected [ 'src/fork.ts', 'src/oldcut.ts' ]).

🤖 Generated with Claude Code

The previous-release-cut rule treated any non-upstream commit touching a file
as fork work. The 2026.10.5 sync landed as a squash commit (#57), which touches
every file that cut changed, so a trial merge of release/2026.10.10 left 410
conflicts for the agent instead of the ~67 the fork actually changed.

Compare main against the newest release commit it already contains instead,
and take the release's deletion when the target dropped such a file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tomorrowflow
tomorrowflow merged commit 8712c6e into main Oct 19, 2026
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