Skip to content

chore: track origin EE branch in worktree setup when absent locally#9504

Draft
hugocasa wants to merge 1 commit into
mainfrom
chore/ee-worktree-track-remote-branch
Draft

chore: track origin EE branch in worktree setup when absent locally#9504
hugocasa wants to merge 1 commit into
mainfrom
chore/ee-worktree-track-remote-branch

Conversation

@hugocasa

@hugocasa hugocasa commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improves wm_setup_ee_worktree in scripts/worktree-common.sh so that when the current branch's matching EE branch exists on origin but isn't checked out locally in the EE repo, the worktree tracks origin/<branch> instead of silently branching off main and dropping the EE-side work already pushed to the remote.

Changes

  • Add an elif arm that, when no matching local branch exists, checks for refs/remotes/origin/<branch> via git show-ref and creates the worktree on a new local branch tracking origin/<branch>.
  • Differentiate the success messages across the three outcomes (existing local branch / tracking origin / new branch from main).

Test plan

  • Branch exists on EE origin only (no local EE branch): setup prints "Created EE worktree ... (tracking origin/)" and git -C <worktree> rev-parse --abbrev-ref @{u} reports origin/<branch>
  • Existing local EE branch: still uses it (message: "existing local branch")
  • No local or remote EE branch: still falls back to a new branch from main

Summary by cubic

Prevents EE worktrees from branching off main when a matching branch exists only on origin. wm_setup_ee_worktree now creates a local branch that tracks origin/<branch> to keep remote EE work intact.

  • Bug Fixes
    • If no local EE branch exists but origin/<branch> does, create the worktree on a new local branch tracking origin/<branch>.
    • Clarified success messages for: existing local branch, tracking origin/<branch>, and new branch from main.

Written for commit 8129616. Summary will update on new commits.

Review in cubic

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8129616
Status: ✅  Deploy successful!
Preview URL: https://1ca4bc5d.windmill.pages.dev
Branch Preview URL: https://chore-ee-worktree-track-remo.windmill.pages.dev

View logs

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