Skip to content

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

Unify hook skipping under `--no-hooks`

Maximilian Roos7cc5b1c5faf5
diff --git a/README.md b/README.md
index 302a4c07a..bdb2adf86 100644
--- a/README.md
+++ b/README.md
@@ -137,6 +137,24 @@ Template variables expand at runtime:
- `{repo_root}` - Absolute path to repository root
- `{target}` - Target branch (pre-merge-check only)
+### Available Hooks
+
+Worktrunk provides three lifecycle hooks for project automation:
+
+| Hook | When It Runs | Execution | Failure Behavior |
+|------|--------------|-----------|------------------|
+| **post-create-command** | After `git worktree add` completes | Sequential, blocking | Logs warning, continues with remaining commands |
+| **post-start-command** | After post-create completes | Parallel, non-blocking (background processes) | Logs warning, doesn't affect switch result |
+| **pre-merge-check** | Before committing/rebasing during `wt merge` | Sequential, blocking, fail-fast | Terminates merge immediately |
+
+**Skipping hooks:**
+- Use `--no-hooks` to skip all project hooks
+- `wt switch --no-hooks` skips post-create and post-start
+- `wt merge --no-hooks` skips pre-merge-check
+
+**Security:**
+Commands require approval on first run. Approved commands are saved globally per project. Use `--force` to bypass approval prompts.
+
## Customization
### Worktree Paths
@@ -196,6 +214,7 @@ wt list --branches # also show branches without worktrees
wt switch feature-branch
wt switch --create new-feature
wt switch --create new-feature --base develop
+wt switch feature-branch --no-hooks # skip post-create and post-start hooks
```
**Run command after switching:**
@@ -219,6 +238,7 @@ wt merge main # merge commits as-is
wt merge main --squash # squash all commits
wt merge main --keep # keep worktree after merging
wt merge main -m "Custom message instruction"
+wt merge main --no-hooks # skip pre-merge-check hook
```
## Configuration
@@ -252,5 +272,3 @@ This project is pre-release. Breaking changes are expected and acceptable. The b
## License
MIT
-test
-test
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 21903f100..d80a056c9 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -14,7 +14,7 @@ pub fn handle_merge(
squash: bool,
keep: bool,
message: Option<&str>,
- no_verify: bool,
+ no_hooks: bool,
force: bool,
) -> Result<(), GitError> {
let repo = Repository::current();
@@ -43,9 +43,9 @@ pub fn handle_merge(
let config = WorktrunkConfig::load()
.map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))?;
- // Run pre-merge checks unless --no-verify was specified
+ // Run pre-merge checks unless --no-hooks was specified
// Do this BEFORE committing so we fail fast if checks won't pass
- if !no_verify && let Ok(Some(project_config)) = ProjectConfig::load(&repo.worktree_root()?) {
+ if !no_hooks && let Ok(Some(project_config)) = ProjectConfig::load(&repo.worktree_root()?) {
let worktree_path = std::env::current_dir().map_err(|e| {
GitError::CommandFailed(format!("Failed to get current directory: {}", e))
})?;
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index aa8acf76a..c2a4d8ffa 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -147,7 +147,7 @@ pub fn handle_switch(
create: bool,
base: Option<&str>,
force: bool,
- no_config_commands: bool,
+ no_hooks: bool,
config: &WorktrunkConfig,
) -> Result<SwitchResult, GitError> {
let repo = Repository::current();
@@ -214,12 +214,12 @@ pub fn handle_switch(
})?;
// Execute post-create commands (sequential, blocking)
- if !no_config_commands {
+ if !no_hooks {
execute_post_create_commands(&worktree_path, &repo, config, branch, force)?;
}
// Spawn post-start commands (parallel, background)
- if !no_config_commands {
+ if !no_hooks {
spawn_post_start_commands(&worktree_path, &repo, config, branch, force)?;
}
diff --git a/src/git.rs b/src/git.rs
index 0f030e1a1..a2d4baa07 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -96,7 +96,7 @@ impl std::fmt::Display for GitError {
let error_bold = ERROR.bold();
write!(
f,
- "{ERROR_EMOJI} {ERROR}Pre-merge check failed: {error_bold}{check_name}{error_bold:#}{ERROR:#}\n\n{error}\n\n{HINT_EMOJI} {HINT}Use --no-verify to skip pre-merge checks{HINT:#}"
+ "{ERROR_EMOJI} {ERROR}Pre-merge check failed: {error_bold}{check_name}{error_bold:#}{ERROR:#}\n\n{error}\n\n{HINT_EMOJI} {HINT}Use --no-hooks to skip pre-merge checks{HINT:#}"
)
}
diff --git a/src/main.rs b/src/main.rs
index 0c6a6b186..f832c6816 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -116,9 +116,9 @@ enum Commands {
#[arg(short = 'f', long)]
force: bool,
- /// Skip executing post-start commands from project config
+ /// Skip all project hooks (post-create, post-start)
#[arg(long)]
- no_config_commands: bool,
+ no_hooks: bool,
},
/// Finish current worktree, returning to primary if current
@@ -201,9 +201,9 @@ Skip pre-merge checks:
#[arg(short = 'm', long)]
message: Option<String>,
- /// Skip pre-merge checks
+ /// Skip all project hooks (pre-merge-check)
#[arg(long)]
- no_verify: bool,
+ no_hooks: bool,
/// Skip approval prompts for commands
#[arg(short, long)]
@@ -359,19 +359,12 @@ fn main() {
base,
execute,
force,
- no_config_commands,
+ no_hooks,
} => WorktrunkConfig::load()
.map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))
.and_then(|config| {
- handle_switch(
- &branch,
- create,
- base.as_deref(),
- force,
- no_config_commands,
- &config,
- )
- .and_then(|result| handle_switch_output(&result, &branch, execute.as_deref()))
+ handle_switch(&branch, create, base.as_deref(), force, no_hooks, &config)
+ .and_then(|result| handle_switch_output(&result, &branch, execute.as_deref()))
}),
Commands::Remove { worktree } => {
handle_remove(worktree.as_deref()).and_then(|result| handle_remove_output(&result))
@@ -385,14 +378,14 @@ fn main() {
squash,
keep,
message,
- no_verify,
+ no_hooks,
force,
} => handle_merge(
target.as_deref(),
squash,
keep,
message.as_deref(),
- no_verify,
+ no_hooks,
force,
),
Commands::Completion { shell } => {
diff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rs
index 00ef71be0..d883c2673 100644
--- a/tests/integration_tests/merge.rs
+++ b/tests/integration_tests/merge.rs
@@ -901,7 +901,7 @@ fn test_merge_pre_merge_check_failure() {
}
#[test]
-fn test_merge_pre_merge_check_no_verify() {
+fn test_merge_pre_merge_check_no_hooks() {
let mut repo = TestRepo::new();
repo.commit("Initial commit");
repo.setup_remote("main");
@@ -941,11 +941,11 @@ fn test_merge_pre_merge_check_no_verify() {
.output()
.expect("Failed to commit");
- // Merge with --no-verify - should skip pre-merge checks and succeed
+ // Merge with --no-hooks - should skip pre-merge checks and succeed
snapshot_merge(
- "merge_pre_merge_check_no_verify",
+ "merge_pre_merge_check_no_hooks",
&repo,
- &["main", "--no-verify"],
+ &["main", "--no-hooks"],
Some(&feature_wt),
);
}
diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rs
index bc0b62749..ff70cdc5d 100644
--- a/tests/integration_tests/switch.rs
+++ b/tests/integration_tests/switch.rs
@@ -243,14 +243,14 @@ fn test_switch_no_config_commands_execute_still_runs() {
repo.commit("Initial commit");
snapshot_switch(
- "switch_no_config_commands_execute_still_runs",
+ "switch_no_hooks_execute_still_runs",
&repo,
&[
"--create",
- "no-config-commands-test",
+ "no-hooks-test",
"--execute",
"echo 'execute command runs'",
- "--no-config-commands",
+ "--no-hooks",
],
);
}
@@ -298,11 +298,11 @@ command = "{}"
)
.expect("Failed to write user config");
- // With --no-config-commands, the post-start command should be skipped
+ // With --no-hooks, the post-start command should be skipped
snapshot_switch_with_home(
- "switch_no_config_commands_skips_post_start",
+ "switch_no_hooks_skips_post_start",
&repo,
- &["--create", "no-post-start", "--no-config-commands"],
+ &["--create", "no-post-start", "--no-hooks"],
Some(temp_home.path()),
&[],
);
@@ -314,17 +314,17 @@ fn test_switch_no_config_commands_with_existing_worktree() {
repo.commit("Initial commit");
// Create a worktree first
- repo.add_worktree("existing-no-config-commands", "existing-no-config-commands");
+ repo.add_worktree("existing-no-hooks", "existing-no-hooks");
- // With --no-config-commands, the --execute command should still run
+ // With --no-hooks, the --execute command should still run
snapshot_switch(
- "switch_no_config_commands_existing",
+ "switch_no_hooks_existing",
&repo,
&[
- "existing-no-config-commands",
+ "existing-no-hooks",
"--execute",
"echo 'execute still runs'",
- "--no-config-commands",
+ "--no-hooks",
],
);
}
@@ -349,16 +349,11 @@ fn test_switch_no_config_commands_with_force() {
repo.commit("Add config");
- // With --no-config-commands, even --force shouldn't execute config commands
+ // With --no-hooks, even --force shouldn't execute config commands
snapshot_switch_with_home(
- "switch_no_config_commands_with_force",
+ "switch_no_hooks_with_force",
&repo,
- &[
- "--create",
- "force-no-config-commands",
- "--force",
- "--no-config-commands",
- ],
+ &["--create", "force-no-hooks", "--force", "--no-hooks"],
Some(temp_home.path()),
&[],
);
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index 1d7e1ad74..5bbba7cb1 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -11,10 +11,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiVd1K8/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpWAueHV/test-config.toml
---
success: true
exit_code: 0
@@ -307,7 +308,7 @@ _wt() {
return 0
;;
wt__merge)
- opts="-s -k -m -f -v -h --squash --keep --message --no-verify --force --verbose --help [TARGET]"
+ opts="-s -k -m -f -v -h --squash --keep --message --no-hooks --force --verbose --help [TARGET]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -357,7 +358,7 @@ _wt() {
return 0
;;
wt__switch)
- opts="-c -b -x -f -v -h --create --base --execute --force --no-config-commands --verbose --help <BRANCH>"
+ opts="-c -b -x -f -v -h --create --base --execute --force --no-hooks --verbose --help <BRANCH>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap
index 6c678bec8..777c79e49 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap
@@ -13,10 +13,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpehaTjD/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmptsYUgK/test-config.toml
---
success: true
exit_code: 0
@@ -309,7 +310,7 @@ _wt() {
return 0
;;
wt__merge)
- opts="-s -k -m -f -v -h --squash --keep --message --no-verify --force --verbose --help [TARGET]"
+ opts="-s -k -m -f -v -h --squash --keep --message --no-hooks --force --verbose --help [TARGET]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -359,7 +360,7 @@ _wt() {
return 0
;;
wt__switch)
- opts="-c -b -x -f -v -h --create --base --execute --force --no-config-commands --verbose --help <BRANCH>"
+ opts="-c -b -x -f -v -h --create --base --execute --force --no-hooks --verbose --help <BRANCH>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 505001d04..333d677d4 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -15,7 +15,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpebsQWN/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpW2Kqyf/test-config.toml
---
success: true
exit_code: 0
@@ -209,7 +209,7 @@ complete -c wt -n "__fish_wt_using_subcommand switch" -s b -l base -d 'Base bran
complete -c wt -n "__fish_wt_using_subcommand switch" -s x -l execute -d 'Execute command after switching' -r
complete -c wt -n "__fish_wt_using_subcommand switch" -s c -l create -d 'Create a new branch'
complete -c wt -n "__fish_wt_using_subcommand switch" -s f -l force -d 'Skip confirmation prompt'
-complete -c wt -n "__fish_wt_using_subcommand switch" -l no-config-commands -d 'Skip executing post-start commands from project config'
+complete -c wt -n "__fish_wt_using_subcommand switch" -l no-hooks -d 'Skip all project hooks (post-create, post-start)'
complete -c wt -n "__fish_wt_using_subcommand switch" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand switch" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand remove" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
@@ -220,7 +220,7 @@ complete -c wt -n "__fish_wt_using_subcommand push" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand merge" -s m -l message -d 'Custom instruction for commit message generation' -r
complete -c wt -n "__fish_wt_using_subcommand merge" -s s -l squash -d 'Squash all commits into one before merging'
complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t remove)'
-complete -c wt -n "__fish_wt_using_subcommand merge" -l no-verify -d 'Skip pre-merge checks'
+complete -c wt -n "__fish_wt_using_subcommand merge" -l no-hooks -d 'Skip all project hooks (pre-merge-check)'
complete -c wt -n "__fish_wt_using_subcommand merge" -s f -l force -d 'Skip approval prompts for commands'
complete -c wt -n "__fish_wt_using_subcommand merge" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand merge" -s h -l help -d 'Print help (see more with \'--help\')'
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 7b6d7ee4c..0ae60ea76 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -15,7 +15,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMPNR02/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpX1Xmrk/test-config.toml
---
success: true
exit_code: 0
@@ -216,7 +216,7 @@ _arguments "${_arguments_options[@]}" : \
'--create[Create a new branch]' \
'-f[Skip confirmation prompt]' \
'--force[Skip confirmation prompt]' \
-'--no-config-commands[Skip executing post-start commands from project config]' \
+'--no-hooks[Skip all project hooks (post-create, post-start)]' \
'-v[Enable verbose output (show git commands and debug info)]' \
'--verbose[Enable verbose output (show git commands and debug info)]' \
'-h[Print help]' \
@@ -251,7 +251,7 @@ _arguments "${_arguments_options[@]}" : \
'--squash[Squash all commits into one before merging]' \
'-k[Keep worktree after merging (don'\''t remove)]' \
'--keep[Keep worktree after merging (don'\''t remove)]' \
-'--no-verify[Skip pre-merge checks]' \
+'--no-hooks[Skip all project hooks (pre-merge-check)]' \
'-f[Skip approval prompts for commands]' \
'--force[Skip approval prompts for commands]' \
'-v[Enable verbose output (show git commands and debug info)]' \
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap
index 43f7f9f9b..10385603c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap
@@ -16,9 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfXHSYJ/test-config.toml
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcfsqxn/test-config.toml
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcfsqxn/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmplG3FdQ/test-config.toml
---
success: false
exit_code: 1
@@ -32,4 +30,4 @@ exit_code: 1
Command failed with exit code: exit status: 1
-πŸ’‘ Use --no-verify to skip pre-merge checks
+πŸ’‘ Use --no-hooks to skip pre-merge checks
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_hooks.snap
similarity index 94%
rename from tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap
rename to tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_hooks.snap
index 29afa7597..03a2c2778 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_hooks.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--no-verify"
+ - "--no-hooks"
env:
CLICOLOR_FORCE: "1"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfulZfY/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphA2A3W/test-config.toml
---
success: true
exit_code: 0
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap
similarity index 73%
rename from tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap
rename to tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap
index 0867b51f5..52e5269dd 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap
@@ -5,25 +5,26 @@ info:
args:
- switch
- "--create"
- - no-config-commands-test
+ - no-hooks-test
- "--execute"
- "echo 'execute command runs'"
- - "--no-config-commands"
+ - "--no-hooks"
env:
CLICOLOR_FORCE: "1"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpLp8aL0/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpL6Tipj/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-βœ… Created new worktree for no-config-commands-test at [REPO].no-config-commands-test
+βœ… Created new worktree for no-hooks-test at [REPO].no-hooks-test
execute command runs
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
similarity index 71%
rename from tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap
rename to tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
index bdf202372..b5da34299 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
@@ -4,25 +4,26 @@ info:
program: wt
args:
- switch
- - existing-no-config-commands
+ - existing-no-hooks
- "--execute"
- "echo 'execute still runs'"
- - "--no-config-commands"
+ - "--no-hooks"
env:
CLICOLOR_FORCE: "1"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpSCHl0U/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUzmGZI/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-βœ… Switched to worktree for existing-no-config-commands at [WORKTREE_EXISTING_NO_CONFIG_COMMANDS]
+βœ… Switched to worktree for existing-no-hooks at [WORKTREE_EXISTING_NO_HOOKS]
execute still runs
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap
similarity index 82%
rename from tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap
rename to tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap
index e6b841dbc..ce442d1a9 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- no-post-start
- - "--no-config-commands"
+ - "--no-hooks"
env:
CLICOLOR_FORCE: "1"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
@@ -14,11 +14,11 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYcTYDe
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMbg8dD
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpodyzRm/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp92MvSm/test-config.toml
---
success: true
exit_code: 0
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
similarity index 67%
rename from tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap
rename to tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
index 126c78f97..6652e6025 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
@@ -5,9 +5,9 @@ info:
args:
- switch
- "--create"
- - force-no-config-commands
+ - force-no-hooks
- "--force"
- - "--no-config-commands"
+ - "--no-hooks"
env:
CLICOLOR_FORCE: "1"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
@@ -15,16 +15,16 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp58teba
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpg6pglk
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpnE4vcU/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpNOkzZH/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-βœ… Created new worktree for force-no-config-commands at [REPO].force-no-config-commands
+βœ… Created new worktree for force-no-hooks at [REPO].force-no-hooks
To enable automatic cd, run: wt configure-shell