Skip to content

Let --base take a local branch, drop --existing - #4

Open
migueltorresvalls wants to merge 2 commits into
mainfrom
add-existing-branch-worktree
Open

Let --base take a local branch, drop --existing#4
migueltorresvalls wants to merge 2 commits into
mainfrom
add-existing-branch-worktree

Conversation

@migueltorresvalls

@migueltorresvalls migueltorresvalls commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Replace --existing with local-branch support in --base.

Use case: a migration in one task unblocks a feature in another, and I want
them as two PRs and two Linear issues — so the second task has to start from
the first one's branch and see its code.

tsk create migration-x -a ../../apps/gov-fr
# ...work on the migration...

tsk create feature-y
cd feature-y && tsk add --base migration-x ../../apps/gov-fr
# → new branch `feature-y` starting from `migration-x`, lands as a stacked PR

--existing couldn't do this: git refuses to check one branch out in two
worktrees, so task A's branch was never available to task B.

Changes:

  • --base accepts <remote>/<branch> or a local branch name; remote wins on ambiguity, a local base skips the fetch
  • git worktree add gets a fully-qualified start point — the short form is ambiguous to git when a local branch is named e.g. origin/main
  • --existing removed from tsk add, usage, and README

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 18, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

--existing could never serve its use case: git refuses to check one branch
out in two worktrees, so a branch already live in another task was never
available to a second one. Branching from it is the only thing git permits,
and it's what the stacked-PR workflow wants anyway.

- --base takes <remote>/<branch> or a local branch name; remote wins on
  ambiguity, and a local base skips the fetch
- Pass a fully-qualified start point to `git worktree add` — the short form
  is ambiguous to git when a local branch is named e.g. origin/main
- Remove --existing from `tsk add`, usage, and README

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@migueltorresvalls migueltorresvalls changed the title Add --existing flag to check out an existing branch Let --base take a local branch, drop --existing Jul 27, 2026
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