Worktrunk Bot
Worktrunk Bot
Done — #1633 makes `pre-switch` template variables point to the target worktree: - `{{ worktree_path }}` → destination worktree path (for existing worktrees; falls back to current for creates where...
Yes — `pre-switch` is already blocking today (it runs synchronously before the switch happens, and a non-zero exit code aborts the switch). That's what makes it suitable here. The PR...
Good question. When creating a new worktree, **both hooks fire but at different phases**, so there's no double-copy problem: **`pre-switch`** fires first, but since the target worktree doesn't exist yet,...
No — that's not accurate, apologies for the confusion. `copy-ignored` is a standalone command (`wt step copy-ignored`) that must be run explicitly. It is **not** invoked automatically during `post-create` or...
@IdoHadar here's a cohesive summary of how to set this up, covering both switching to existing worktrees and creating new ones: ### Setup Add these two hooks to your `wt.toml`:...
@IdoHadar Several PRs landed recently that redesigned hook template variables (#1655, #1660, #1679). Here's how it all works now: ### What changed - **`{{ worktree_path }}`** in `pre-switch` now points...
@IdoHadar No — deleted files are **not** synced. Both the `cp -r` approach and `wt step copy-ignored` are purely additive: they copy files that exist in the source to the...
Thanks for reporting this! I was able to reproduce the issue and identified the root cause: in bare repos, all worktrees are linked (`is_linked() = true`), so the guard that...
**Has this always been the case?** Yes — since the protection was first introduced in 278dfaa1. The original check used `is_in_worktree()` which compared `git_dir != common_dir`. In bare repos, every...
Good question — they're actually not duplicative because `wt merge` and `wt remove` take different code paths. `wt merge` bypasses `prepare_worktree_removal()` entirely — it constructs the `RemoveResult` directly ([`merge.rs:271`](https://github.com/max-sixty/worktrunk/blob/eabf4aac/src/commands/merge.rs#L271)). So...