Skip to content

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

feat: Add and standardize --stage option and config

Maximilian Roosb8ba573600d5
diff --git a/.claude-plugin/skills/worktrunk/reference/README.md b/.claude-plugin/skills/worktrunk/reference/README.md
index 77a2856f0..857dd73d8 100644
--- a/.claude-plugin/skills/worktrunk/reference/README.md
+++ b/.claude-plugin/skills/worktrunk/reference/README.md
@@ -409,7 +409,7 @@ Options:
--no-remove Keep worktree after merge
--no-verify Skip all project hooks
-f, --force Skip approval prompts
- --tracked-only Stage tracked files only
+ --stage <STAGE> What to stage before committing [default: all] [possible values: all, tracked, none]
-h, --help Print help
Global Options:
diff --git a/README.md b/README.md
index 77a2856f0..857dd73d8 100644
--- a/README.md
+++ b/README.md
@@ -409,7 +409,7 @@ Options:
--no-remove Keep worktree after merge
--no-verify Skip all project hooks
-f, --force Skip approval prompts
- --tracked-only Stage tracked files only
+ --stage <STAGE> What to stage before committing [default: all] [possible values: all, tracked, none]
-h, --help Print help
Global Options:
diff --git a/dev/config.example.toml b/dev/config.example.toml
index 18e38b0b5..4d78a9233 100644
--- a/dev/config.example.toml
+++ b/dev/config.example.toml
@@ -156,14 +156,17 @@ worktree-path = "../{{ main_worktree }}.{{ branch }}"
# branches = false # Include branches without worktrees by default
# remotes = false # Include remote branches by default
+# Commit Defaults (shared by `wt beta commit`, `wt beta squash`, and `wt merge`)
+# [commit]
+# stage = "all" # What to stage: "all", "tracked", or "none"
+
# Merge Command Defaults
-# Configure default behavior for `wt merge`
+# Note: `stage` defaults from [commit] section above
# [merge]
# squash = true # Squash commits when merging
# commit = true # Create commit after merge
# remove = true # Remove worktree after merge
# verify = true # Run project hooks
-# tracked-only = false # Stage tracked files only
# Approved Commands
# Commands approved for automatic execution after switching worktrees
diff --git a/src/cli.rs b/src/cli.rs
index a73166a61..c8c2f000c 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -303,6 +303,10 @@ pub enum StandaloneCommand {
/// Skip pre-commit hooks
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
verify: bool,
+
+ /// What to stage before committing [default: all]
+ #[arg(long)]
+ stage: Option<crate::commands::commit::StageMode>,
},
/// Squash commits with LLM message
@@ -320,6 +324,10 @@ pub enum StandaloneCommand {
/// Skip pre-commit hooks
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
verify: bool,
+
+ /// What to stage before committing [default: all]
+ #[arg(long)]
+ stage: Option<crate::commands::commit::StageMode>,
},
/// Push changes to local target branch
@@ -697,7 +705,7 @@ wt remove # (when already in main worktree)
Commit → Squash → Rebase → Pre-merge hooks → Push → Cleanup → Post-merge hooks
**Commit**: Uncommitted changes are staged and committed with LLM message.
-Use `--tracked-only` to stage only tracked files.
+Use `--stage=tracked` to stage only tracked files, or `--stage=none` to commit only what's already staged.
**Squash**: Multiple commits are squashed into one with LLM message.
Skip with `--no-squash`. Safety backup: `git reflog show refs/wt-backup/<branch>`
@@ -775,12 +783,8 @@ wt merge --no-verify
#[arg(short, long)]
force: bool,
- /// Stage tracked files only
- #[arg(long, overrides_with = "no_tracked_only")]
- tracked_only: bool,
-
- /// Stage all files (tracked and untracked)
- #[arg(long = "no-tracked-only", overrides_with = "tracked_only", hide = true)]
- no_tracked_only: bool,
+ /// What to stage before committing [default: all]
+ #[arg(long)]
+ stage: Option<crate::commands::commit::StageMode>,
},
}
diff --git a/src/commands/commit.rs b/src/commands/commit.rs
index 9c7460da2..56f81df72 100644
--- a/src/commands/commit.rs
+++ b/src/commands/commit.rs
@@ -7,12 +7,15 @@ use super::command_executor::CommandContext;
use super::hooks::HookPipeline;
use super::repository_ext::RepositoryCliExt;
+// Re-export StageMode from config for use by CLI
+pub use worktrunk::config::StageMode;
+
/// Options for committing current changes.
pub struct CommitOptions<'a> {
pub ctx: &'a CommandContext<'a>,
pub target_branch: Option<&'a str>,
pub no_verify: bool,
- pub tracked_only: bool,
+ pub stage_mode: StageMode,
pub auto_trust: bool,
pub warn_about_untracked: bool,
pub show_no_squash_note: bool,
@@ -25,7 +28,7 @@ impl<'a> CommitOptions<'a> {
ctx,
target_branch: None,
no_verify: false,
- tracked_only: false,
+ stage_mode: StageMode::All,
auto_trust: false,
warn_about_untracked: true,
show_no_squash_note: false,
@@ -134,20 +137,29 @@ impl CommitOptions<'_> {
pipeline.run_pre_commit(&project_config, self.target_branch, self.auto_trust)?;
}
- if self.warn_about_untracked && !self.tracked_only {
+ if self.warn_about_untracked && self.stage_mode == StageMode::All {
self.ctx.repo.warn_if_auto_staging_untracked()?;
}
- if self.tracked_only {
- self.ctx
- .repo
- .run_command(&["add", "-u"])
- .context("Failed to stage tracked changes")?;
- } else {
- self.ctx
- .repo
- .run_command(&["add", "-A"])
- .context("Failed to stage changes")?;
+ // Stage changes based on mode
+ match self.stage_mode {
+ StageMode::All => {
+ // Stage everything: tracked modifications + untracked files
+ self.ctx
+ .repo
+ .run_command(&["add", "-A"])
+ .context("Failed to stage changes")?;
+ }
+ StageMode::Tracked => {
+ // Stage tracked modifications only (no untracked files)
+ self.ctx
+ .repo
+ .run_command(&["add", "-u"])
+ .context("Failed to stage tracked changes")?;
+ }
+ StageMode::None => {
+ // Stage nothing - commit only what's already in the index
+ }
}
CommitGenerator::new(&self.ctx.config.commit_generation)
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index e50499f52..c57d4c90e 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -66,7 +66,7 @@ pub fn handle_merge(
remove: bool,
verify: bool,
force: bool,
- tracked_only: bool,
+ stage_mode: super::commit::StageMode,
) -> anyhow::Result<()> {
let env = CommandEnv::current()?;
let repo = &env.repo;
@@ -124,9 +124,9 @@ pub fn handle_merge(
let mut options = CommitOptions::new(&ctx);
options.target_branch = Some(&target_branch);
options.no_verify = !verify;
- options.tracked_only = tracked_only;
+ options.stage_mode = stage_mode;
options.auto_trust = true;
- options.warn_about_untracked = !tracked_only;
+ options.warn_about_untracked = stage_mode == super::commit::StageMode::All;
options.show_no_squash_note = true;
options.commit()?;
@@ -138,14 +138,7 @@ pub fn handle_merge(
// Squash commits if enabled - track whether squashing occurred
let squashed = if squash_enabled {
- super::standalone::handle_squash(
- Some(&target_branch),
- force,
- !verify,
- true,
- tracked_only,
- !tracked_only,
- )?
+ super::standalone::handle_squash(Some(&target_branch), force, !verify, true, stage_mode)?
} else {
false
};
diff --git a/src/commands/standalone.rs b/src/commands/standalone.rs
index 945af2356..0758305df 100644
--- a/src/commands/standalone.rs
+++ b/src/commands/standalone.rs
@@ -60,13 +60,20 @@ fn check_hook_configured<T>(hook: &Option<T>, hook_type: HookType) -> anyhow::Re
}
/// Handle `wt beta commit` command
-pub fn handle_standalone_commit(force: bool, no_verify: bool) -> anyhow::Result<()> {
+pub fn handle_standalone_commit(
+ force: bool,
+ no_verify: bool,
+ stage_mode: super::commit::StageMode,
+) -> anyhow::Result<()> {
let env = CommandEnv::current()?;
let ctx = env.context(force);
let mut options = CommitOptions::new(&ctx);
options.no_verify = no_verify;
+ options.stage_mode = stage_mode;
options.auto_trust = false;
options.show_no_squash_note = false;
+ // Only warn about untracked if we're staging all
+ options.warn_about_untracked = stage_mode == super::commit::StageMode::All;
options.commit()
}
@@ -75,8 +82,7 @@ pub fn handle_standalone_commit(force: bool, no_verify: bool) -> anyhow::Result<
///
/// # Arguments
/// * `auto_trust` - If true, skip approval prompts for pre-commit commands (already approved in batch)
-/// * `tracked_only` - Stage only tracked files (mirrors `--tracked-only` in merge)
-/// * `warn_about_untracked` - Emit a warning before auto-staging untracked files
+/// * `stage_mode` - What to stage before committing (All or Tracked; None not supported for squash)
///
/// Returns true if a commit or squash operation occurred, false if nothing needed to be done
pub fn handle_squash(
@@ -84,9 +90,10 @@ pub fn handle_squash(
force: bool,
skip_pre_commit: bool,
auto_trust: bool,
- tracked_only: bool,
- warn_about_untracked: bool,
+ stage_mode: super::commit::StageMode,
) -> anyhow::Result<bool> {
+ use super::commit::StageMode;
+
let env = CommandEnv::current()?;
let repo = &env.repo;
let current_branch = env.branch.clone();
@@ -97,16 +104,19 @@ pub fn handle_squash(
let target_branch = repo.resolve_target_branch(target)?;
// Auto-stage changes before running pre-commit hooks so both beta and merge paths behave identically
- if warn_about_untracked && !tracked_only {
- repo.warn_if_auto_staging_untracked()?;
- }
-
- if tracked_only {
- repo.run_command(&["add", "-u"])
- .context("Failed to stage tracked changes")?;
- } else {
- repo.run_command(&["add", "-A"])
- .context("Failed to stage changes")?;
+ match stage_mode {
+ StageMode::All => {
+ repo.warn_if_auto_staging_untracked()?;
+ repo.run_command(&["add", "-A"])
+ .context("Failed to stage changes")?;
+ }
+ StageMode::Tracked => {
+ repo.run_command(&["add", "-u"])
+ .context("Failed to stage tracked changes")?;
+ }
+ StageMode::None => {
+ // Stage nothing - use what's already staged
+ }
}
// Run pre-commit hook unless explicitly skipped
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 55d40ea7b..4c34a0bfc 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -48,7 +48,8 @@ pub use commands::{Command, CommandConfig, CommandPhase};
pub use expansion::{expand_command_template, expand_template};
pub use project::ProjectConfig;
pub use user::{
- CommitGenerationConfig, UserProjectConfig, WorktrunkConfig, get_config_path, set_config_path,
+ CommitGenerationConfig, StageMode, UserProjectConfig, WorktrunkConfig, get_config_path,
+ set_config_path,
};
#[cfg(test)]
@@ -79,6 +80,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
@@ -94,6 +96,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
@@ -109,6 +112,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
@@ -125,6 +129,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
@@ -140,6 +145,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
@@ -156,6 +162,7 @@ mod tests {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
};
assert_eq!(
diff --git a/src/config/user.rs b/src/config/user.rs
index 7216791df..09a343c0f 100644
--- a/src/config/user.rs
+++ b/src/config/user.rs
@@ -20,6 +20,29 @@ pub fn set_config_path(path: PathBuf) {
use super::expansion::expand_template;
+/// What to stage before committing
+#[derive(
+ Debug,
+ Clone,
+ Copy,
+ Default,
+ PartialEq,
+ Eq,
+ clap::ValueEnum,
+ serde::Serialize,
+ serde::Deserialize,
+)]
+#[serde(rename_all = "lowercase")]
+pub enum StageMode {
+ /// Stage everything: untracked files + unstaged tracked changes
+ #[default]
+ All,
+ /// Stage tracked changes only (like `git add -u`)
+ Tracked,
+ /// Stage nothing, commit only what's already in the index
+ None,
+}
+
/// User-level configuration for worktree path formatting and LLM integration.
///
/// This config is stored at `~/.config/worktrunk/config.toml` (or platform equivalent)
@@ -76,6 +99,10 @@ pub struct WorktrunkConfig {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub list: Option<ListConfig>,
+ /// Configuration for the `wt beta commit` command (also used by merge)
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub commit: Option<CommitConfig>,
+
/// Configuration for the `wt merge` command
#[serde(default, skip_serializing_if = "Option::is_none")]
pub merge: Option<MergeConfig>,
@@ -166,7 +193,20 @@ pub struct ListConfig {
pub remotes: Option<bool>,
}
+/// Configuration for the `wt beta commit` command
+///
+/// Also used by `wt merge` for shared settings like `stage`.
+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
+pub struct CommitConfig {
+ /// What to stage before committing (default: all)
+ /// Values: "all", "tracked", "none"
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub stage: Option<StageMode>,
+}
+
/// Configuration for the `wt merge` command
+///
+/// Note: `stage` defaults from `[commit]` section, not here.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct MergeConfig {
/// Squash commits when merging (default: true)
@@ -184,10 +224,6 @@ pub struct MergeConfig {
/// Run project hooks (default: true)
#[serde(skip_serializing_if = "Option::is_none")]
pub verify: Option<bool>,
-
- /// Stage tracked files only (default: false)
- #[serde(rename = "tracked-only", skip_serializing_if = "Option::is_none")]
- pub tracked_only: Option<bool>,
}
impl Default for WorktrunkConfig {
@@ -197,6 +233,7 @@ impl Default for WorktrunkConfig {
commit_generation: CommitGenerationConfig::default(),
projects: std::collections::BTreeMap::new(),
list: None,
+ commit: None,
merge: None,
}
}
diff --git a/src/main.rs b/src/main.rs
index b00035453..3d3841ff4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -272,12 +272,31 @@ fn main() {
StandaloneCommand::RunHook { hook_type, force } => {
handle_standalone_run_hook(hook_type, force)
}
- StandaloneCommand::Commit { force, verify } => handle_standalone_commit(force, !verify),
+ StandaloneCommand::Commit {
+ force,
+ verify,
+ stage,
+ } => WorktrunkConfig::load()
+ .context("Failed to load config")
+ .and_then(|config| {
+ let stage_final = stage
+ .or_else(|| config.commit.and_then(|c| c.stage))
+ .unwrap_or_default();
+ handle_standalone_commit(force, !verify, stage_final)
+ }),
StandaloneCommand::Squash {
target,
force,
verify,
- } => handle_squash(target.as_deref(), force, !verify, false, false, true).map(|_| ()),
+ stage,
+ } => WorktrunkConfig::load()
+ .context("Failed to load config")
+ .and_then(|config| {
+ let stage_final = stage
+ .or_else(|| config.commit.and_then(|c| c.stage))
+ .unwrap_or_default();
+ handle_squash(target.as_deref(), force, !verify, false, stage_final).map(|_| ())
+ }),
StandaloneCommand::Push {
target,
allow_merge_commits,
@@ -448,8 +467,7 @@ fn main() {
verify,
no_verify,
force,
- tracked_only,
- no_tracked_only,
+ stage,
} => WorktrunkConfig::load()
.context("Failed to load config")
.and_then(|config| {
@@ -468,16 +486,17 @@ fn main() {
let commit_default = merge_config.and_then(|m| m.commit).unwrap_or(true);
let remove_default = merge_config.and_then(|m| m.remove).unwrap_or(true);
let verify_default = merge_config.and_then(|m| m.verify).unwrap_or(true);
- let tracked_only_default =
- merge_config.and_then(|m| m.tracked_only).unwrap_or(false);
// CLI flags override config, config overrides defaults
let squash_final = flag_pair(squash, no_squash).unwrap_or(squash_default);
let commit_final = flag_pair(commit, no_commit).unwrap_or(commit_default);
let remove_final = flag_pair(remove, no_remove).unwrap_or(remove_default);
let verify_final = flag_pair(verify, no_verify).unwrap_or(verify_default);
- let tracked_only_final =
- flag_pair(tracked_only, no_tracked_only).unwrap_or(tracked_only_default);
+
+ // Stage defaults from [commit] config section
+ let stage_final = stage
+ .or_else(|| config.commit.and_then(|c| c.stage))
+ .unwrap_or_default();
handle_merge(
target.as_deref(),
@@ -486,7 +505,7 @@ fn main() {
remove_final,
verify_final,
force,
- tracked_only_final,
+ stage_final,
)
}),
};
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge.snap b/tests/snapshots/integration__integration_tests__help__help_merge.snap
index 540fcf11a..ae6e28790 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge.snap
@@ -38,8 +38,13 @@ Options:
-f, --force
Skip approval prompts
- --tracked-only
- Stage tracked files only
+ --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')
@@ -59,7 +64,8 @@ Global Options:
Commit → Squash → Rebase → Pre-merge hooks → Push → Cleanup → Post-merge hooks
Commit: Uncommitted changes are staged and committed with LLM message.
-Use --tracked-only to stage only tracked files.
+Use --stage=tracked to stage only tracked files, or --stage=none to commit only
+what's already staged.
Squash: Multiple commits are squashed into one with LLM message.
Skip with --no-squash. Safety backup: git reflog show refs/wt-backup/<branch>
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index f39db5501..09012cd67 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpb2n8Kq/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsHzJ9y/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpb2n8Kq/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsHzJ9y/test-config.toml
---
success: true
exit_code: 0
@@ -305,12 +305,16 @@ _wt() {
return 0
;;
wt__beta__commit)
- opts="-f -C -v -h --force --no-verify --config --verbose --help"
+ opts="-f -C -v -h --force --no-verify --stage --config --verbose --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -415,12 +419,16 @@ _wt() {
return 0
;;
wt__beta__squash)
- opts="-f -C -v -h --force --no-verify --config --verbose --help [TARGET]"
+ opts="-f -C -v -h --force --no-verify --stage --config --verbose --help [TARGET]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${cur}"))
return 0
@@ -761,12 +769,16 @@ _wt() {
return 0
;;
wt__merge)
- opts="-f -C -v -h --squash --no-squash --commit --no-commit --remove --no-remove --verify --no-verify --force --tracked-only --no-tracked-only --config --verbose --help [TARGET]"
+ opts="-f -C -v -h --squash --no-squash --commit --no-commit --remove --no-remove --verify --no-verify --force --stage --config --verbose --help [TARGET]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
+ --stage)
+ COMPREPLY=($(compgen -W "all tracked none" -- "${cur}"))
+ return 0
+ ;;
-C)
COMPREPLY=($(compgen -f "${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 8bb73e396..59f792dd4 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmprnIggk/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4gevyj/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmprnIggk/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4gevyj/test-config.toml
---
success: true
exit_code: 0
@@ -252,12 +252,18 @@ complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_f
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s f -l force -d 'Skip approval prompts'
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s v -l verbose -d 'Show commands and debug info'
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from run-hook" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
+tracked\t'Stage tracked changes only (like git add -u)'
+none\t'Stage nothing, commit only what\'s already in the index'"
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s C -d 'Change working directory' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l config -d 'User config file path' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s f -l force -d 'Skip approval prompts'
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -l no-verify -d 'Skip pre-commit hooks'
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s v -l verbose -d 'Show commands and debug info'
-complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s h -l help -d 'Print help'
+complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from commit" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
+tracked\t'Stage tracked changes only (like git add -u)'
+none\t'Stage nothing, commit only what\'s already in the index'"
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s C -d 'Change working directory' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -l config -d 'User config file path' -r -F
complete -c wt -n "__fish_wt_using_subcommand beta; and __fish_seen_subcommand_from squash" -s f -l force -d 'Skip approval prompts'
@@ -304,6 +310,9 @@ complete -c wt -n "__fish_wt_using_subcommand remove" -s D -l force-delete -d 'D
complete -c wt -n "__fish_wt_using_subcommand remove" -l no-background -d 'Run removal in foreground'
complete -c wt -n "__fish_wt_using_subcommand remove" -s v -l verbose -d 'Show commands and debug info'
complete -c wt -n "__fish_wt_using_subcommand remove" -s h -l help -d 'Print help (see more with \'--help\')'
+complete -c wt -n "__fish_wt_using_subcommand merge" -l stage -d 'What to stage before committing [default: all]' -r -f -a "all\t'Stage everything: untracked files + unstaged tracked changes'
+tracked\t'Stage tracked changes only (like git add -u)'
+none\t'Stage nothing, commit only what\'s already in the index'"
complete -c wt -n "__fish_wt_using_subcommand merge" -s C -d 'Change working directory' -r -F
complete -c wt -n "__fish_wt_using_subcommand merge" -l config -d 'User config file path' -r -F
complete -c wt -n "__fish_wt_using_subcommand merge" -l squash -d 'Force commit squashing'
@@ -315,8 +324,6 @@ complete -c wt -n "__fish_wt_using_subcommand merge" -l no-remove -d 'Keep workt
complete -c wt -n "__fish_wt_using_subcommand merge" -l verify -d 'Force running project hooks'
complete -c wt -n "__fish_wt_using_subcommand merge" -l no-verify -d 'Skip all project hooks'
complete -c wt -n "__fish_wt_using_subcommand merge" -s f -l force -d 'Skip approval prompts'
-complete -c wt -n "__fish_wt_using_subcommand merge" -l tracked-only -d 'Stage tracked files only'
-complete -c wt -n "__fish_wt_using_subcommand merge" -l no-tracked-only -d 'Stage all files (tracked and untracked)'
complete -c wt -n "__fish_wt_using_subcommand merge" -s v -l verbose -d 'Show 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 d9be428e8..55225a59b 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -12,13 +12,13 @@ info:
COLUMNS: "150"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyIHHFh/test-gitconfig
+ GIT_CONFIG_GLOBAL: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmd08Pi/test-gitconfig
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyIHHFh/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmd08Pi/test-config.toml
---
success: true
exit_code: 0
@@ -425,6 +425,9 @@ _arguments "${_arguments_options[@]}" : \
;;
(commit)
_arguments "${_arguments_options[@]}" : \
+'--stage=[What to stage before committing \[default\: all\]]:STAGE:((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"))' \
'-C+[Change working directory]:path:_files' \
'--config=[User config file path]:path:_files' \
'-f[Skip approval prompts]' \
@@ -432,12 +435,15 @@ _arguments "${_arguments_options[@]}" : \
'--no-verify[Skip pre-commit hooks]' \
'-v[Show commands and debug info]' \
'--verbose[Show commands and debug info]' \
-'-h[Print help]' \
-'--help[Print help]' \
+'-h[Print help (see more with '\''--help'\'')]' \
+'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(squash)
_arguments "${_arguments_options[@]}" : \
+'--stage=[What to stage before committing \[default\: all\]]:STAGE:((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"))' \
'-C+[Change working directory]:path:_files' \
'--config=[User config file path]:path:_files' \
'-f[Skip approval prompts]' \
@@ -541,6 +547,9 @@ _arguments "${_arguments_options[@]}" : \
;;
(merge)
_arguments "${_arguments_options[@]}" : \
+'--stage=[What to stage before committing \[default\: all\]]:STAGE:((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"))' \
'-C+[Change working directory]:path:_files' \
'--config=[User config file path]:path:_files' \
'--squash[Force commit squashing]' \
@@ -553,8 +562,6 @@ _arguments "${_arguments_options[@]}" : \
'--no-verify[Skip all project hooks]' \
'-f[Skip approval prompts]' \
'--force[Skip approval prompts]' \
-'--tracked-only[Stage tracked files only]' \
-'--no-tracked-only[Stage all files (tracked and untracked)]' \
'-v[Show commands and debug info]' \
'--verbose[Show commands and debug info]' \
'-h[Print help (see more with '\''--help'\'')]' \