Skip to content

bug: wt hook pre-start uses FailFast instead of Warn #1703

Closed

Description

@worktrunk-bot

Bug

wt hook pre-start uses HookFailureStrategy::FailFast (aborts on failure), but execute_pre_start_commands during automatic worktree creation uses HookFailureStrategy::Warn (warns and continues).

The documentation in wt hook --help explicitly says:

failure aborts the operation (except pre-start, which warns and continues)

Reproduction

# Configure a pre-start hook that fails
wt config create --hooks.pre-start='["false"]'

# Manual invocation aborts (bug — should warn and continue)
wt hook pre-start  # exits non-zero

# Automatic invocation during create warns and continues (correct)
wt switch --create test-branch

Root Cause

In src/commands/hook_commands.rs:265, HookType::PreStart is grouped with PreSwitch, PreRemove, PreCommit, and PreMerge in the FailFast match arm. It should have its own match arm using HookFailureStrategy::Warn, matching the behavior in src/commands/worktree/hooks.rs:28.

Fix

Separate PreStart from the FailFast group and give it Warn strategy.

Activity

  1. added a commit that references this issue on Mar 24, 2026
    dfab49c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions