Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ $ wt config alias show deploy

/// Preview an alias invocation with template expansion
#[command(
after_long_help = r#"Runs the same parser used at invocation time, applies template expansion (including `{{ args }}` and any `--KEY=VALUE` assignments), and prints the resulting command without executing it. Templates referencing `vars.*` are shown unexpanded — those values resolve from git config at execution time, after earlier steps have had a chance to set them.
after_long_help = r#"Runs the same parser used at invocation time, applies template expansion (including `{{ args }}` and any `--KEY=VALUE` assignments), and prints the resulting command without executing it. Each `{{ vars.<key> }}` renders as itself while everything around it expands — those values resolve from git config at execution time, after earlier steps have had a chance to set them.

Arguments after `--` are forwarded verbatim as if typed after `wt <name>`.

Expand Down
7 changes: 3 additions & 4 deletions src/commands/config/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ fn warn_if_shadowed(name: &str) {
/// and print the rendered command(s) without executing.
///
/// Rendering goes through [`render_template_preview`], which mirrors
/// execution-time semantics: templates referencing `vars.*` are shown raw
/// (after syntax validation) because those values resolve from git config
/// when the step runs, potentially written by earlier pipeline steps. Other
/// templates expand against the current context.
/// execution-time semantics for everything but `{{ vars.<key> }}`: each of
/// those renders as itself, because the value resolves from git config when
/// the step runs, potentially written by an earlier pipeline step.
pub fn handle_alias_dry_run(name: String, args: Vec<String>) -> anyhow::Result<()> {
let repo = Repository::current()?;
let user_config = repo.user_config();
Expand Down
Loading