gabriel / muse public
fix BREAKING push dev
gabriel · 70 days ago · Apr 7, 2026 · Diff

fix(push): stop merge-commit BFS at nearest already-remote ancestor

When pushing a merge commit, branch_have previously contained only the target branch's remote HEAD. The BFS in walk_commits followed parent2's chain with no stop anchor, walking the merged branch's entire history and sending thousands of already-remote commits to the server.

Fix: when the local HEAD is a merge commit, append all known remote branch heads to branch_have. The BFS then stops at the nearest already-remote commit on parent2's chain — sending only the merge commit plus the N new commits between the remote's stale branch tip and parent2, not the full ancestry.

Using all remote heads is safe for merge commits: parent1 is the target branch's remote HEAD (one direct hop), so there is no intermediate branch between remote_head and local_head to trigger the fast-forward verification problem on parent1's chain.

Adds three regression tests covering: - merge where both branch HEADs are exact remote heads (sends 1 commit) - merge where merged branch is N commits ahead of remote (sends N+1) - merge push exits 0 (smoke)

sha256:02b055a39cb0a0976db28c18a8372bf12b43303cdb8711cf38236d8af0b799b2 sha
sha256:40bd7f9500f98245d128233a5187c0be338ddad78ac0cec157d8687a091d2eed snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:02b055a39cb0a0976db28c18a8372bf12b43303cdb8711cf38236d8af0b799b2 --body "your comment"