Skip to content
This repository was archived by the owner on Sep 22, 2026. It is now read-only.

Add --start-point flag for custom branch base - #33

Merged
ffalor merged 8 commits into
mainfrom
opencode/issue29-20260222162544
Feb 22, 2026
Merged

ffalor merged 8 commits into
mainfrom
opencode/issue29-20260222162544

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

I've implemented the --start-point flag to allow basing new branches on something other than the default (HEAD for local branches/issues, FETCH_HEAD for PRs).

Changes made to cmd/add.go:

  1. Added new flag: --start-point - specifies the starting point for the new branch (e.g., branch, tag, commit)
  2. Updated createFromPR, createFromIssue, and createFromLocal to use the flag when provided
  3. Added usage examples

Usage:

# Create worktree from a specific branch
gh wt add my-feature-branch --start-point develop

# Create worktree from a specific commit
gh wt add my-feature-branch --start-point abc123

Closes #29

New%20session%20-%202026-02-22T16%3A25%3A44.212Z
opencode session  |  github run

Co-authored-by: ffalor <ffalor@users.noreply.github.com>
@ffalor

ffalor commented Feb 22, 2026

Copy link
Copy Markdown
Owner

/oc use --base and -b for the flag. For PR's the base will be from the PR so this flag will need to be ignored.

Co-authored-by: ffalor <ffalor@users.noreply.github.com>
@opencode-agent

Copy link
Copy Markdown
Contributor Author

Done. Changes made:

  1. Changed flag from --start-point to --base with -b shorthand
  2. Updated examples to use --base
  3. In createFromPR, now always uses FETCH_HEAD (ignores the --base flag since base comes from PR)
  4. createFromIssue and createFromLocal still use the flag when provided

New%20session%20-%202026-02-22T16%3A38%3A28.080Z
opencode session  |  github run

@ffalor
ffalor force-pushed the opencode/issue29-20260222162544 branch from 416bdea to d0138f8 Compare February 22, 2026 17:14
@ffalor
ffalor merged commit 66f73df into main Feb 22, 2026
2 checks passed
@ffalor
ffalor deleted the opencode/issue29-20260222162544 branch February 22, 2026 18:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow basing new branch on something other than HEAD : git worktree add -b <new-branch-name> <path> [<commit-ish>]

1 participant