Skip to content

fix(continuum-update): handle divergent-branches by fast-forwarding to origin/main (Carl-UX #101) - #1031

Merged
joelteply merged 1 commit into
canaryfrom
fix/continuum-update-divergent-branches
May 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/continuum-update-divergent-branches

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Carl-UX QA #101 (codex-b741, 2026-05-03 18:33Z): Joel's canary install hit fatal: Need to specify how to reconcile divergent branches on every continuum update.

Pre-fix cmd_update ran git pull origin main unconditionally — fails whenever the local install dir has any commits not on main, which happens with bare-repo + worktree setups, agent tab branches, or any user who's just touched something locally.

Fix

The install dir is a managed deployment, not a workspace for local edits. Contract: align with origin/main.

  • git fetch origin main (no merge conflict surface)
  • Stash uncommitted/staged changes with timestamped name as safety net
  • git reset --hard origin/main to align with remote
  • Both git commands fail-fast with clear error

The stash name lets users recover with git stash apply stash^{/continuum-update-backup-...} if they had real work in flight.

Verification

  • bash -n bin/continuum syntax-clean
  • Repro case: install dir on a feature branch + canary ahead of main → pre-fix bails, post-fix succeeds

🤖 Generated with Claude Code

…o origin/main

Carl-UX QA #101 (codex-b741, 2026-05-03 18:33Z): Joel's canary install
hit `fatal: Need to specify how to reconcile divergent branches` on
every `continuum update`. Pre-fix `cmd_update` ran `git pull origin main`
unconditionally — fails whenever the local install dir has any commits
not on main, which happens with bare-repo + worktree setups, agent tab
branches, or any user who's just touched something locally.

The install dir is a managed deployment, not a workspace for local
edits. If users want to keep local commits they should be working in
a separate worktree (the bare-repo+worktree pattern already supports
this). For the install dir, the contract is: align with origin/main.

Fix:
- `git fetch origin main` first (no merge conflict surface)
- Stash uncommitted/staged changes with timestamped name as a safety
  net (so accidentally-edited files don't vanish without trace)
- `git reset --hard origin/main` to align with remote
- Both git commands fail-fast with a clear error if they break

The stash name lets the user recover with `git stash list` + `git stash
apply stash^{/continuum-update-backup-...}` if they had real work in
flight.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 108bbc3 into canary May 3, 2026
2 checks passed
@joelteply
joelteply deleted the fix/continuum-update-divergent-branches branch May 3, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant