Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Remove redundant --help-page snapshot tests (#579)

Maximilian Roos3fee985684ad
diff --git a/tests/integration_tests/help.rs b/tests/integration_tests/help.rs
index 241dda0b5..315ed871d 100644
--- a/tests/integration_tests/help.rs
+++ b/tests/integration_tests/help.rs
@@ -118,50 +118,6 @@ fn test_help_md_subcommand() {
});
}
-#[test]
-fn test_help_page_merge() {
- let mut settings = Settings::clone_current();
- settings.set_snapshot_path("../snapshots");
- settings.bind(|| {
- let mut cmd = wt_command();
- cmd.args(["merge", "--help-page"]);
- assert_cmd_snapshot!("help_page_merge", cmd);
- });
-}
-
-#[test]
-fn test_help_page_switch() {
- let mut settings = Settings::clone_current();
- settings.set_snapshot_path("../snapshots");
- settings.bind(|| {
- let mut cmd = wt_command();
- cmd.args(["switch", "--help-page"]);
- assert_cmd_snapshot!("help_page_switch", cmd);
- });
-}
-
-#[test]
-fn test_help_page_no_subcommand() {
- let mut settings = Settings::clone_current();
- settings.set_snapshot_path("../snapshots");
- settings.bind(|| {
- let mut cmd = wt_command();
- cmd.arg("--help-page");
- assert_cmd_snapshot!("help_page_no_subcommand", cmd);
- });
-}
-
-#[test]
-fn test_help_page_unknown_command() {
- let mut settings = Settings::clone_current();
- settings.set_snapshot_path("../snapshots");
- settings.bind(|| {
- let mut cmd = wt_command();
- cmd.args(["nonexistent", "--help-page"]);
- assert_cmd_snapshot!("help_page_unknown", cmd);
- });
-}
-
/// Verifies that markdown tables remain intact (no mid-row breaks) even when
/// table width exceeds terminal width. Tables should extend past 80 columns
/// rather than wrap incorrectly.
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
deleted file mode 100644
index be0598a8c..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
+++ /dev/null
@@ -1,157 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - merge
- - "--help-page"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SOURCE_DATE_EPOCH: "1735776000"
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
----
-success: true
-exit_code: 0
------ stdout -----
-<!-- ⚠️ AUTO-GENERATED from `wt merge --help-page` — edit cli.rs to update -->
-
-Merge the current branch into the target branch, defaulting to the main branch. Unlike `git merge`, this merges the current branch into a target (rather than a target into the current branch). Similar to clicking "Merge pull request" on GitHub.
-
-<figure class="demo">
-<picture>
- <source srcset="/assets/docs/dark/wt-merge.gif" media="(prefers-color-scheme: dark)">
- <img src="/assets/docs/light/wt-merge.gif" alt="wt merge demo" width="1600" height="900">
-</picture>
-</figure>
-
-## Examples
-
-Merge to the default branch:
-
-```bash
-wt merge
-```
-
-Merge to a different branch:
-
-```bash
-wt merge develop
-```
-
-Keep the worktree after merging:
-
-```bash
-wt merge --no-remove
-```
-
-Preserve commit history (no squash):
-
-```bash
-wt merge --no-squash
-```
-
-Skip committing/squashing (rebase still runs unless --no-rebase):
-
-```bash
-wt merge --no-commit
-```
-
-## Pipeline
-
-`wt merge` runs these steps:
-
-1. **Squash** — Stages uncommitted changes, then combines all commits since target into one (like GitHub's "Squash and merge"). Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. A backup ref is saved to `refs/wt-backup/<branch>`. With `--no-squash`, uncommitted changes become a separate commit and individual commits are preserved.
-2. **Rebase** — Rebases onto target if behind. Skipped if already up-to-date. Conflicts abort immediately.
-3. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](@/hook.md).
-4. **Merge** — Fast-forward merge to the target branch. Non-fast-forward merges are rejected.
-5. **Pre-remove hooks** — Hooks run before removing worktree. Failures abort.
-6. **Cleanup** — Removes the worktree and branch. Use `--no-remove` to keep the worktree. When already on the target branch or in the main worktree, the worktree is preserved.
-7. **Post-merge hooks** — Hooks run after cleanup. Failures are logged but don't abort.
-
-Use `--no-commit` to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless `--no-rebase` is passed. Useful after preparing commits manually with `wt step`. Requires a clean working tree.
-
-## Local CI
-
-For personal projects, pre-merge hooks open up the possibility of a workflow with much faster iteration — an order of magnitude more small changes instead of fewer large ones.
-
-Historically, ensuring tests ran before merging was difficult to enforce locally. Remote CI was valuable for the process as much as the checks: it guaranteed validation happened. `wt merge` brings that guarantee local.
-
-The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run `wt merge`, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
-
-```toml
-[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-```
-
-## See also
-
-- [`wt step`](@/step.md) — Run individual operations (commit, squash, rebase, push)
-- [`wt remove`](@/remove.md) — Remove worktrees without merging
-- [`wt switch`](@/switch.md) — Navigate to other worktrees
-
-## Command reference
-
-```
-wt merge - Merge worktree into target branch
-
-Squash & rebase, fast-forward target, remove the worktree.
-
-Usage: wt merge [OPTIONS] [TARGET]
-
-Arguments:
- [TARGET]
- Target branch
- 
- Defaults to default branch.
-
-Options:
- --no-squash
- Skip commit squashing
-
- --no-commit
- Skip commit and squash
-
- --no-rebase
- Skip rebase (fail if not already rebased)
-
- --no-remove
- Keep worktree after merge
-
- --no-verify
- Skip hooks
-
- -y, --yes
- Skip approval prompts
-
- --stage <STAGE>
- What to stage before committing [default: all]
-
- Possible values:
- - all: Stage everything: untracked files + unstaged tracked
- changes
- - tracked: Stage tracked changes only (like git add -u)
- - none: Stage nothing, commit only what's already in the index
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Show debug info (-v), or also write diagnostic report (-vv)
-```
-
-<!-- END AUTO-GENERATED from `wt merge --help-page` -->
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_no_subcommand.snap b/tests/snapshots/integration__integration_tests__help__help_page_no_subcommand.snap
deleted file mode 100644
index d0af7a6e5..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_page_no_subcommand.snap
+++ /dev/null
@@ -1,22 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - "--help-page"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SOURCE_DATE_EPOCH: "1735776000"
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-Usage: wt <command> --help-page
-Commands with pages: merge, switch, remove, list
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap b/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
deleted file mode 100644
index 4df27cbf7..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
+++ /dev/null
@@ -1,163 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - switch
- - "--help-page"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SOURCE_DATE_EPOCH: "1735776000"
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
----
-success: true
-exit_code: 0
------ stdout -----
-<!-- ⚠️ AUTO-GENERATED from `wt switch --help-page` — edit cli.rs to update -->
-
-Change directory to a worktree, creating one if needed.
-
-<figure class="demo">
-<picture>
- <source srcset="/assets/docs/dark/wt-switch.gif" media="(prefers-color-scheme: dark)">
- <img src="/assets/docs/light/wt-switch.gif" alt="wt switch demo" width="1600" height="900">
-</picture>
-</figure>
-
-Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike `git switch`, this navigates between worktrees rather than changing branches in place.
-
-## Examples
-
-```bash
-wt switch feature-auth # Switch to worktree
-wt switch - # Previous worktree (like cd -)
-wt switch --create new-feature # Create new branch and worktree
-wt switch --create hotfix --base production
-```
-
-## Creating a branch
-
-The `--create` flag creates a new branch from the `--base` branch (defaults to default branch). Without `--create`, the branch must already exist.
-
-## Creating worktrees
-
-If the branch already has a worktree, `wt switch` changes directories to it. Otherwise, it creates one, running [hooks](@/hook.md).
-
-When creating a worktree, worktrunk:
-
-1. Creates worktree at configured path
-2. Switches to new directory
-3. Runs [post-create hooks](@/hook.md#post-create) (blocking)
-4. Spawns [post-start hooks](@/hook.md#post-start) (background)
-
-```bash
-wt switch feature # Existing branch → creates worktree
-wt switch --create feature # New branch and worktree
-wt switch --create fix --base release # New branch from release
-wt switch --create temp --no-verify # Skip hooks
-```
-
-## Shortcuts
-
-| Shortcut | Meaning |
-|----------|---------|
-| `^` | Default branch (`main`/`master`) |
-| `@` | Current branch/worktree |
-| `-` | Previous worktree (like `cd -`) |
-
-```bash
-wt switch - # Back to previous
-wt switch ^ # Default branch worktree
-wt switch --create fix --base=@ # Branch from current HEAD
-```
-
-## When wt switch fails
-
-- **Branch doesn't exist** — Use `--create`, or check `wt list --branches`
-- **Path occupied** — Another worktree is at the target path; switch to it or remove it
-- **Stale directory** — Use `--clobber` to remove a non-worktree directory at the target path
-
-To change which branch a worktree is on, use `git switch` inside that worktree.
-
-## See also
-
-- [`wt select`](@/select.md) — Interactive worktree selection
-- [`wt list`](@/list.md) — View all worktrees
-- [`wt remove`](@/remove.md) — Delete worktrees when done
-- [`wt merge`](@/merge.md) — Integrate changes back to the default branch
-
-## Command reference
-
-```
-wt switch - Switch to a worktree
-
-Usage: wt switch [OPTIONS] <BRANCH> [-- <EXECUTE_ARGS>...]
-
-Arguments:
- <BRANCH>
- Branch name
- 
- Shortcuts: '^' (default branch), '-' (previous), '@' (current)
-
- [EXECUTE_ARGS]...
- Additional arguments for --execute command (after --)
- 
- Arguments after -- are appended to the execute command. Each argument
- is POSIX shell-escaped before appending.
-
-Options:
- -c, --create
- Create a new branch
-
- -b, --base <BASE>
- Base branch
- 
- Defaults to default branch.
-
- -x, --execute <EXECUTE>
- Command to run after switch
- 
- Replaces the wt process with the command after switching, giving it
- full terminal control. Useful for launching editors, AI agents, or
- other interactive tools.
- 
- Especially useful with shell aliases:
- 
- alias wsc='wt switch --create -x claude'
- wsc feature-branch -- 'Fix GH #322'
- 
- Then wsc feature-branch creates the worktree and launches Claude Code.
- Arguments after -- are passed to the command, so wsc feature -- 'Fix
- GH #322' runs claude 'Fix GH #322', starting Claude with a prompt.
-
- -y, --yes
- Skip approval prompts
-
- --clobber
- Remove stale paths at target
-
- --no-verify
- Skip hooks
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Show debug info (-v), or also write diagnostic report (-vv)
-```
-
-<!-- END AUTO-GENERATED from `wt switch --help-page` -->
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_unknown.snap b/tests/snapshots/integration__integration_tests__help__help_page_unknown.snap
deleted file mode 100644
index 139627240..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_page_unknown.snap
+++ /dev/null
@@ -1,22 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - nonexistent
- - "--help-page"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SOURCE_DATE_EPOCH: "1735776000"
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-Unknown command: nonexistent