worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

`switch` docs

Open max-sixty opened this issue 8 months ago • 4 comments

@worktrunk-bot this part:


Upstream tracking: Branches created with --create have no upstream tracking configured. This prevents accidental pushes to the wrong branch — for example, --base origin/main would otherwise make git push target main. Use git push -u origin <branch> to set up tracking as needed.

Without --create, switching to a remote branch (e.g., wt switch feature when only origin/feature exists) creates a local branch tracking the remote — this is the standard git behavior and is preserved.

seems too detailed and prominent in our wt switch docs

so

  • do we need it? how different to git's behavior are we? possibly if the same then we don't?
  • if we do, let's move down

max-sixty avatar Mar 14 '26 17:03 max-sixty

additionally, in another PR:

I think this missed some hooks?

When creating a worktree, worktrunk:

Creates worktree at configured path
Switches to new directory
Runs post-create hooks (blocking)
Spawns post-start hooks (background)

max-sixty avatar Mar 14 '26 17:03 max-sixty

additionally in another PR:

can we combine the GitHub and GitLab sections more? the repetition makes the docs seem sparse

max-sixty avatar Mar 14 '26 17:03 max-sixty

@worktrunk-bot this issue was dropped due to a concurrency race (fixed in #1519). Please pick it up.

max-sixty avatar Mar 14 '26 20:03 max-sixty

Addressed all three points in #1521:

  1. Trimmed upstream tracking paragraph — --create not setting upstream tracking is standard git switch -c behavior, so the prominent explanation was unnecessary. Condensed to a single sentence folded into the existing paragraph.

  2. Added missing hooks to creation lifecycle — The numbered list now includes pre-switch (step 1) and post-switch (step 6), matching the actual execution order in handle_switch.rs.

  3. Combined GitHub/GitLab sections — Merged the two near-identical sections into a single "Pull requests and merge requests" section.

CI is green across all platforms.

worktrunk-bot avatar Mar 14 '26 21:03 worktrunk-bot