Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: always branch new worktrees from remote-tracking refs#100

Merged
matt2e merged 2 commits intomainfrom
matt2e/branches-from-origin
Feb 13, 2026
Merged

fix: always branch new worktrees from remote-tracking refs#100
matt2e merged 2 commits intomainfrom
matt2e/branches-from-origin

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Feb 13, 2026

New branches now always start from the remote tip (e.g. origin/main) instead of a potentially stale local ref.

Changes

  • detect_default_branch – always returns the origin/<branch> form, even when only a local ref is present, so new worktrees are never based on an outdated local HEAD.
  • create_worktree – when the start point is a remote-tracking ref, performs a best-effort git fetch of that ref before creating the worktree, ensuring the branch starts from the real remote tip.

When creating a new worktree with a remote-tracking start point (e.g.
origin/main), fetch the latest from the remote first so the branch
starts from the up-to-date remote tip rather than a potentially stale
local copy. The fetch is best-effort — if it fails (e.g. offline), the
worktree is still created from whatever the local ref points to.
detect_default_branch now always returns the remote-tracking form
(e.g. origin/main) instead of falling back to local branch names.
This ensures new worktrees start from the remote tip rather than
the local HEAD, which may be behind.

When origin/main is not yet in the local ref list (e.g. never
fetched), create_worktree will fetch before branching, so returning
the origin/ form is safe.
@matt2e matt2e merged commit 8550697 into main Feb 13, 2026
3 checks passed
@matt2e matt2e deleted the matt2e/branches-from-origin branch February 13, 2026 18:12
taylorkmho added a commit that referenced this pull request Feb 13, 2026
* origin/main:
  fix: surface worktree setup errors instead of showing infinite spinner (#106)
  feat: store data in platform-conventional directories (XDG) (#104)
  feat(notes): add copy-to-clipboard button in NoteModal (#103)
  feat: add use github repo based projects to avoid cloning when using remote branches (#102)
  fix: always branch new worktrees from remote-tracking refs (#100)
  fix: remove debug console.log statements from BranchCard (#97)
  feat: improve PR button UX with push support and conditional visibility (#89)
loganj added a commit that referenced this pull request Feb 26, 2026
* feat: CLI `penpal open` subcommand opens files in desktop app

- Add `penpal open <path>...` subcommand with routing (unknown commands error)
- Replace `openBrowser()` with `openApp()` targeting Penpal.app
- Launch desktop app (instead of bare server) when no instance is running
- Add SSE `navigate` event broadcast from /api/open for live navigation
- Add /api/navigate endpoint for pending navigation on SSE reconnect
- Frontend Layout listens for navigate events and polls on reconnect
- Go unit tests for /api/navigate (empty, set-by-open, consumed)
- Playwright e2e tests for open -> navigate round-trip

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: discover sidecar port dynamically after launching desktop app

Poll ReadPortFile() instead of assuming a hardcoded port when no
server is already running. Falls back to portFlag for backwards
compatibility.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
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.

2 participants