Update `findLatestCompatCommit` to use semantic versioning when identifying the latest compatibility commit. This ensures the correct commit is selected even when upstream tags diverge or are not strictly linear.
- Add semver parsing and comparison utilities
- Implement `targetSemver` to resolve versions from tags or commit messages
- Filter and sort compatibility candidates by version relative to the target version
- Add test case for diverging upstream tags
Add a new setup script to configure `merge.conflictStyle=zdiff3` locally
within the repository. This ensures that the common ancestor is visible
during merge conflicts, which is required for structural resolution by
`mergiraf` and simplifies manual conflict resolution.
The configuration is applied during `bun install` via the `postinstall`
hook and remains as a fallback for the upstream merge utilities.
Update the upstream merge script to identify and link to the previous compatibility commit. This ensures that pre-merge transformations maintain a proper commit history by using multiple parents when a prior compatibility base is found, rather than creating disconnected commits.
- Add `findLatestCompatCommit` to locate previous compatibility commits
- Implement `commitTree` and `updateBranch` for low-level git manipulation
- Update `merge.ts` to integrate compatibility base detection and multi-parent commits
Pass merge.conflictStyle=zdiff3 on the git merge invocation so every
conflicted file gets base-aware (|||||||) markers from the start, not
just the ones runMergiraf happens to touch. Benefits:
- Mergiraf always has a base section to work from, so its structural
heuristics apply uniformly.
- Remaining manual conflicts show both sides relative to the common
ancestor, which is dramatically easier to resolve than a 2-way marker.
Since the working tree already carries diff3 markers after the merge,
drop the per-file `git checkout --conflict=diff3` in runMergiraf.
Uses 'git merge-base --is-ancestor' per tag (parallelized) to mark
upstream versions reachable from HEAD with a '✓ merged' annotation.
Kilo's own package version no longer tracks upstream, so semver
comparison isn't reliable; the ancestor check is the source of truth
and handles non-linear merge history correctly.
Append --tags --force flags to the git fetch upstream command so that
upstream tag references are always updated and locally diverged tags
are overwritten to match the remote state.