LearnNewsExamplesServices
Frontmatter
id8457
titleOptimize Release Squash using Git Plumbing
stateClosed
labels
enhancementbuild
assigneestobiu
createdAtJan 9, 2026, 11:23 AM
updatedAtJan 9, 2026, 11:36 AM
githubUrlhttps://github.com/neomjs/neo/issues/8457
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 9, 2026, 11:36 AM

Optimize Release Squash using Git Plumbing

Closed v11.19.1 enhancementbuild
tobiu
tobiu commented on Jan 9, 2026, 11:23 AM

To resolve persistent merge conflicts during the "Squash to Main" phase of the release workflow, we will replace the high-level git merge strategy with low-level git plumbing commands.

Problem: Massive refactorings and file moves without git mv cause Git's rename detection to fail during git merge --squash, leading to extensive conflicts that require "accept theirs" resolution.

Solution: Implement the "No-Checkout Snapshot" strategy in buildScripts/publishRelease.mjs. Instead of merging, we will construct a new commit on main that points directly to dev's file tree.

Plan: Update buildScripts/publishRelease.mjs to:

  1. Fetch origin/main to get the latest parent hash.
  2. Get the tree hash of the current dev HEAD (git rev-parse HEAD^{tree}).
  3. Use git commit-tree to create a new commit object:
    • Tree: dev's tree
    • Parent: origin/main
    • Message: "vX.Y.Z"
  4. Update the local main ref to this new commit (git update-ref).
  5. Push the new commit to origin/main.

Benefits:

  • Zero Conflicts: Bypasses conflict detection entirely.
  • Performance: Instant execution (no file I/O or checkout).
  • Reliability: Guarantees main is a byte-for-byte copy of dev.
tobiu added the enhancement label on Jan 9, 2026, 11:23 AM
tobiu added the build label on Jan 9, 2026, 11:23 AM
tobiu assigned to @tobiu on Jan 9, 2026, 11:25 AM
tobiu
tobiu Jan 9, 2026, 11:35 AM

Input from Gemini 3 Pro:

✦ Implemented the optimization for the release workflow. The buildScripts/publishRelease.mjs script now uses git commit-tree and git update-ref to create the main branch squash commit. This bypasses the need for git merge, eliminating merge conflicts caused by file renames and moves. The wording in the release notes has also been updated to "All changes delivered in 1 atomic commit:".

tobiu closed this issue on Jan 9, 2026, 11:36 AM
tobiu referenced in commit 22b7fe2 - "feat: Optimize release workflow with git plumbing and wording update (#8457)" on Jan 9, 2026, 11:39 AM