Skip to content

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

Rename project from 'arbor' to 'worktrunk'

Maximilian Roosa9f41918ea77
diff --git a/Cargo.lock b/Cargo.lock
index fbc2ad232..f9c78ae16 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -61,21 +61,6 @@ dependencies = [
"windows-sys 0.60.2",
]
-[[package]]
-name = "arbor"
-version = "0.1.0"
-dependencies = [
- "askama",
- "assert_cmd",
- "clap",
- "confy",
- "insta",
- "insta-cmd",
- "serde",
- "tempfile",
- "toml",
-]
-
[[package]]
name = "askama"
version = "0.14.0"
@@ -1078,3 +1063,18 @@ name = "wit-bindgen"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
+
+[[package]]
+name = "worktrunk"
+version = "0.1.0"
+dependencies = [
+ "askama",
+ "assert_cmd",
+ "clap",
+ "confy",
+ "insta",
+ "insta-cmd",
+ "serde",
+ "tempfile",
+ "toml",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 6485042a3..79704c762 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,14 +1,14 @@
[package]
-name = "arbor"
+name = "worktrunk"
version = "0.1.0"
edition = "2024"
[lib]
-name = "arbor"
+name = "worktrunk"
path = "src/lib.rs"
[[bin]]
-name = "arbor"
+name = "wt"
path = "src/main.rs"
[dependencies]
diff --git a/DEMO.md b/DEMO.md
index 5ef51bc88..1aed60d27 100644
--- a/DEMO.md
+++ b/DEMO.md
@@ -1,10 +1,10 @@
# Shell Integration Demo
-This document demonstrates how Arbor's shell integration works in practice.
+This document demonstrates how Worktrunk's shell integration works in practice.
## Setup
-1. Build arbor:
+1. Build worktrunk:
```bash
cargo build --release
```
@@ -13,12 +13,12 @@ cargo build --release
**Bash** (`~/.bashrc`):
```bash
-eval "$(arbor init bash)"
+eval "$(wt init bash)"
```
**Fish** (`~/.config/fish/config.fish`):
```fish
-arbor init fish | source
+wt init fish | source
```
## Demo: How It Works
@@ -26,21 +26,21 @@ arbor init fish | source
### Step 1: Generate Shell Integration Code
```bash
-$ arbor init bash
-# arbor shell integration for bash
-# Generated by: arbor init bash
+$ wt init bash
+# worktrunk shell integration for bash
+# Generated by: wt init bash
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -51,40 +51,40 @@ _arbor_exec() {
}
# Main commands that support directory changes
-arbor-switch() {
- _arbor_exec switch "$@"
+wt-switch() {
+ _wt_exec switch "$@"
}
-arbor-finish() {
- _arbor_exec finish "$@"
+wt-finish() {
+ _wt_exec finish "$@"
}
# ... (more functions)
```
### Step 2: Understanding the Directive Protocol
-When you run `arbor switch --internal my-feature`, the binary outputs:
+When you run `wt switch --internal my-feature`, the binary outputs:
```
-__ARBOR_CD__/path/to/worktree
+__WORKTRUNK_CD__/path/to/worktree
Switched to worktree: my-feature
```
The shell wrapper:
1. Captures all output
2. Parses line by line
-3. Executes `cd /path/to/worktree` when it sees `__ARBOR_CD__`
+3. Executes `cd /path/to/worktree` when it sees `__WORKTRUNK_CD__`
4. Prints other lines normally
### Step 3: Using the Shell Integration
```bash
# After sourcing the integration code:
-$ eval "$(arbor init bash)"
+$ eval "$(wt init bash)"
-# Now you can use arbor commands:
-$ arbor-switch feature-x
-__ARBOR_CD__/tmp/example-worktree
+# Now you can use wt commands:
+$ wt-switch feature-x
+__WORKTRUNK_CD__/tmp/example-worktree
Switched to worktree: feature-x
# Your shell automatically cd'd to the worktree!
@@ -97,22 +97,22 @@ $ pwd
### Custom Command Prefix
```bash
-# Use 'wt' instead of 'arbor'
-$ eval "$(arbor init bash --cmd wt)"
+# Use a custom prefix instead of default 'wt'
+$ eval "$(wt init bash --cmd myprefix)"
-# Now use wt- commands:
-$ wt-switch feature
-$ wt-finish
-$ wt-list
+# Now use myprefix- commands:
+$ myprefix-switch feature
+$ myprefix-finish
+$ myprefix-list
```
### Enable Prompt Hook
```bash
# Track worktree in every prompt
-$ eval "$(arbor init bash --hook prompt)"
+$ eval "$(wt init bash --hook prompt)"
-# Now arbor hook prompt runs before each prompt
+# Now wt hook prompt runs before each prompt
# (useful for showing current worktree in PS1)
```
@@ -120,7 +120,7 @@ $ eval "$(arbor init bash --hook prompt)"
```bash
# Custom prefix + prompt hook
-$ eval "$(arbor init fish --cmd wt --hook prompt)"
+$ eval "$(wt init fish --cmd myprefix --hook prompt)"
```
## Implementation Architecture
@@ -131,23 +131,23 @@ $ eval "$(arbor init fish --cmd wt --hook prompt)"
│ (bash/fish) │
└────────┬────────┘
│
- │ eval "$(arbor init bash)"
+ │ eval "$(wt init bash)"
▼
┌─────────────────┐
│ Shell Wrapper │ Generated by templates/bash.sh
│ Functions: │
-│ - arbor-switch │ Calls: arbor switch --internal
-│ - arbor-finish │ Calls: arbor finish --internal
-│ - _arbor_exec │ Parses: __ARBOR_CD__ directives
+│ - wt-switch │ Calls: wt switch --internal
+│ - wt-finish │ Calls: wt finish --internal
+│ - _wt_exec │ Parses: __WORKTRUNK_CD__ directives
└────────┬────────┘
│
- │ arbor switch --internal my-branch
+ │ wt switch --internal my-branch
▼
┌─────────────────┐
-│ Arbor Binary │ Rust application
+│ Worktrunk Bin │ Rust application
│ (Rust) │
│ │ Outputs:
-│ Commands: │ - __ARBOR_CD__/path/to/worktree
+│ Commands: │ - __WORKTRUNK_CD__/path/to/worktree
│ - switch │ - Regular messages
│ - finish │
│ - list │
@@ -162,7 +162,7 @@ chmod +x .tmp/test_integration.sh
./.tmp/test_integration.sh
# Expected output:
-# Testing arbor shell integration...
+# Testing worktrunk shell integration...
#
# Test 1: Generate bash integration
# ✓ Bash integration generated successfully
@@ -206,7 +206,7 @@ This "eval init" pattern is proven by successful tools:
### Key Design Decisions:
- Use `--internal` flag (hidden from `--help`) for directive mode
-- Directives use `__ARBOR_CD__` prefix (unlikely to conflict with real output)
+- Directives use `__WORKTRUNK_CD__` prefix (unlikely to conflict with real output)
- Shell wrapper preserves exit codes
- Regular output passes through unchanged
- No state maintained by binary (stateless)
diff --git a/README.md b/README.md
index 550ea9e4b..04e2c5fd1 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Arbor: Git Worktree Management
+# Worktrunk: Git Worktree Management
A Rust-based CLI tool for managing git worktrees with seamless shell integration.
@@ -14,32 +14,32 @@ A Rust-based CLI tool for managing git worktrees with seamless shell integration
```bash
cargo build --release
-# Copy target/release/arbor to a directory in your PATH
+# Copy target/release/wt to a directory in your PATH
```
## Shell Integration Setup
-Arbor uses shell integration to automatically change directories when switching worktrees. Add one of the following to your shell config:
+Worktrunk uses shell integration to automatically change directories when switching worktrees. Add one of the following to your shell config:
### Bash
Add to `~/.bashrc`:
```bash
-eval "$(arbor init bash)"
+eval "$(wt init bash)"
```
### Fish
Add to `~/.config/fish/config.fish`:
```fish
-arbor init fish | source
+wt init fish | source
```
### Zsh
Add to `~/.zshrc`:
```bash
-eval "$(arbor init zsh)"
+eval "$(wt init zsh)"
```
## Usage
@@ -48,51 +48,51 @@ eval "$(arbor init zsh)"
```bash
# List all worktrees
-arbor list
+wt list
# Switch to a worktree (creates if doesn't exist)
-arbor-switch feature-branch
+wt-switch feature-branch
# Finish current worktree and return to primary
-arbor-finish
+wt-finish
# Push changes between worktrees
-arbor push target-worktree
+wt push target-worktree
# Merge and cleanup
-arbor merge main --squash
+wt merge main --squash
```
### Customization
**Custom command prefix:**
```bash
-# Use 'wt' instead of 'arbor'
-eval "$(arbor init bash --cmd wt)"
+# Use a custom prefix instead of 'wt'
+eval "$(wt init bash --cmd myprefix)"
-# Now use: wt-switch, wt-finish, etc.
+# Now use: myprefix-switch, myprefix-finish, etc.
```
**Enable prompt hook:**
```bash
# Track worktree changes in your prompt
-eval "$(arbor init bash --hook prompt)"
+eval "$(wt init bash --hook prompt)"
```
**Disable aliases:**
```bash
-# Don't create short aliases like arbor-sw, arbor-fin
-eval "$(arbor init bash --no-alias)"
+# Don't create short aliases like wt-sw, wt-fin
+eval "$(wt init bash --no-alias)"
```
## How It Works
-Arbor uses a **directive protocol** to communicate with shell wrappers:
+Worktrunk uses a **directive protocol** to communicate with shell wrappers:
-1. Shell wrapper calls `arbor switch --internal my-branch`
-2. Arbor outputs special directives mixed with regular output:
+1. Shell wrapper calls `wt switch --internal my-branch`
+2. Worktrunk outputs special directives mixed with regular output:
```
- __ARBOR_CD__/path/to/worktree
+ __WORKTRUNK_CD__/path/to/worktree
Switched to worktree: my-branch
```
3. Shell wrapper parses output, executes `cd` for directives, displays other lines
@@ -105,7 +105,7 @@ Current implementation:
- ✅ Shell integration infrastructure (eval init pattern)
- ✅ Template-based shell code generation (Askama)
-- ✅ Directive protocol (__ARBOR_CD__)
+- ✅ Directive protocol (__WORKTRUNK_CD__)
- ✅ Basic CLI structure
- ⏳ Git primitives (coming next)
- ⏳ Worktree operations (coming next)
@@ -116,17 +116,17 @@ See [TODO.md](TODO.md) for detailed roadmap.
## Architecture
```
-arbor (Rust binary)
+wt (Rust binary)
├── Core commands (work standalone)
-│ ├── arbor list
-│ ├── arbor remove
-│ └── arbor status
+│ ├── wt list
+│ ├── wt remove
+│ └── wt status
├── Internal commands (for shell wrapper)
-│ ├── arbor switch --internal → outputs __ARBOR_CD__ directives
-│ ├── arbor finish --internal → outputs __ARBOR_CD__ directives
-│ └── arbor hook prompt → for prompt integration
+│ ├── wt switch --internal → outputs __WORKTRUNK_CD__ directives
+│ ├── wt finish --internal → outputs __WORKTRUNK_CD__ directives
+│ └── wt hook prompt → for prompt integration
└── Shell integration
- └── arbor init <shell> → outputs shell wrapper functions
+ └── wt init <shell> → outputs shell wrapper functions
```
## Design Principles
@@ -138,7 +138,7 @@ arbor (Rust binary)
## Inspiration
-Arbor's shell integration pattern is inspired by successful tools:
+Worktrunk's shell integration pattern is inspired by successful tools:
- **zoxide**: Smarter cd with frequency tracking
- **starship**: Cross-shell prompt customization
diff --git a/TODO.md b/TODO.md
index 7cd4cb850..19475f1ab 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,4 +1,4 @@
-# Arbor: Git Worktree Management in Rust
+# Worktrunk: Git Worktree Management in Rust
Port of git worktree fish functions to a Rust crate with enhanced capabilities.
@@ -123,17 +123,17 @@ Ensure correctness with real git repositories.
### Architecture
```
-arbor (Rust binary)
+wt (Rust binary)
├── Core commands (work standalone)
-│ ├── arbor list
-│ ├── arbor remove
-│ └── arbor status
+│ ├── wt list
+│ ├── wt remove
+│ └── wt status
├── Internal commands (for shell wrapper)
-│ ├── arbor switch --internal → outputs __ARBOR_CD__ directives
-│ ├── arbor finish --internal → outputs __ARBOR_CD__ directives
-│ └── arbor hook prompt → for prompt integration
+│ ├── wt switch --internal → outputs __WORKTRUNK_CD__ directives
+│ ├── wt finish --internal → outputs __WORKTRUNK_CD__ directives
+│ └── wt hook prompt → for prompt integration
└── Shell integration
- └── arbor init <shell> → outputs shell wrapper functions
+ └── wt init <shell> → outputs shell wrapper functions
```
### Implementation Pattern
@@ -141,14 +141,14 @@ arbor (Rust binary)
**User setup (one-time):**
```bash
# Add to ~/.bashrc or ~/.config/fish/config.fish
-eval "$(arbor init bash)" # or: arbor init fish | source
+eval "$(wt init bash)" # or: wt init fish | source
```
**Generated shell wrapper:**
```bash
-arbor-switch() {
+wt-switch() {
local output
- output=$(arbor switch --internal "$@")
+ output=$(wt switch --internal "$@")
# Parse output for special directives
while IFS= read -r line; do
@@ -182,7 +182,7 @@ Another output line
1. **Template Engine**: Use Askama for type-safe shell code generation
2. **Shell Support**: Start with Bash and Fish, extend to Zsh later
3. **Customization Flags**:
- - `--cmd <prefix>`: Customize command prefix (default: "arbor")
+ - `--cmd <prefix>`: Customize command prefix (default: "wt")
- `--hook <mode>`: Control tracking updates (none, prompt)
- `--no-alias`: Skip creating convenience aliases
@@ -198,10 +198,10 @@ Another output line
- [ ] Add Askama dependency
- [ ] Create `Shell` enum (Bash, Fish, Zsh)
- [ ] Create `ShellInit` struct with template rendering
-- [ ] Implement `arbor init <shell>` command
+- [ ] Implement `wt init <shell>` command
- [ ] Create Bash template with basic wrapper functions
- [ ] Create Fish template with basic wrapper functions
-- [ ] Implement `__ARBOR_CD__` directive protocol
+- [ ] Implement `__WORKTRUNK_CD__` directive protocol
**Phase 2: Integration**
- [ ] Add `--internal` flag to `switch` and `finish` commands
@@ -271,9 +271,9 @@ Following Rust 2018+ conventions:
tests/
common/
mod.rs # Shared test helpers (TestRepo, etc.)
- test_list.rs # Integration tests for `arbor list`
- test_switch.rs # Integration tests for `arbor switch` (future)
- test_finish.rs # Integration tests for `arbor finish` (future)
+ test_list.rs # Integration tests for `wt list`
+ test_switch.rs # Integration tests for `wt switch` (future)
+ test_finish.rs # Integration tests for `wt finish` (future)
snapshots/ # Generated by insta
test_list__*.snap
```
@@ -327,7 +327,7 @@ fn snapshot_cmd(repo: &TestRepo, args: &[&str]) -> String {
settings.add_regex(r"\\", "/");
settings.bind(|| {
- assert_cmd_snapshot!(Command::new(get_cargo_bin("arbor")).args(args));
+ assert_cmd_snapshot!(Command::new(get_cargo_bin("wt")).args(args));
});
}
```
diff --git a/src/config.rs b/src/config.rs
index 8a1bb3a5b..f456319b2 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,12 +1,12 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
-pub struct ArborConfig {
+pub struct WorktrunkConfig {
#[serde(rename = "worktree-path")]
pub worktree_path: String,
}
-impl Default for ArborConfig {
+impl Default for WorktrunkConfig {
fn default() -> Self {
Self {
worktree_path: "{repo}.{branch}".to_string(),
@@ -14,8 +14,8 @@ impl Default for ArborConfig {
}
}
-pub fn load_config() -> Result<ArborConfig, confy::ConfyError> {
- confy::load("arbor", None)
+pub fn load_config() -> Result<WorktrunkConfig, confy::ConfyError> {
+ confy::load("worktrunk", None)
}
#[cfg(test)]
@@ -24,13 +24,13 @@ mod tests {
#[test]
fn test_default_config() {
- let config = ArborConfig::default();
+ let config = WorktrunkConfig::default();
assert_eq!(config.worktree_path, "{repo}.{branch}");
}
#[test]
fn test_config_serialization() {
- let config = ArborConfig::default();
+ let config = WorktrunkConfig::default();
let toml = toml::to_string(&config).unwrap();
assert!(toml.contains("worktree-path"));
assert!(toml.contains("{repo}.{branch}"));
diff --git a/src/git.rs b/src/git.rs
index 758bd658e..47a1c8aa1 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -192,8 +192,8 @@ fn query_remote_default_branch(path: &std::path::Path) -> Result<String, GitErro
/// Parse the output of `git ls-remote --symref origin HEAD`
/// Expected format:
/// ```text
-/// ref: refs/heads/main HEAD
-/// 85a1ce7c7182540f9c02453441cb3e8bf0ced214 HEAD
+/// ref: refs/heads/main HEAD
+/// 85a1ce7c7182540f9c02453441cb3e8bf0ced214 HEAD
/// ```
fn parse_remote_default_branch(output: &str) -> Result<String, GitError> {
for line in output.lines() {
diff --git a/src/main.rs b/src/main.rs
index 116e2e683..dfd2f9e8e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,11 +1,10 @@
use clap::{Parser, Subcommand};
-use arbor::config::ArborConfig;
-use arbor::git::{GitError, list_worktrees};
-use arbor::shell;
+use worktrunk::git::{GitError, list_worktrees};
+use worktrunk::shell;
use std::process;
#[derive(Parser)]
-#[command(name = "arbor")]
+#[command(name = "wt")]
#[command(about = "Git worktree management", long_about = None)]
struct Cli {
#[command(subcommand)]
@@ -19,8 +18,8 @@ enum Commands {
/// Shell to generate code for (bash, fish, zsh)
shell: String,
- /// Command prefix (default: arbor)
- #[arg(long, default_value = "arbor")]
+ /// Command prefix (default: wt)
+ #[arg(long, default_value = "wt")]
cmd: String,
/// Hook mode (none, prompt)
@@ -97,8 +96,8 @@ fn main() {
}
fn handle_init(shell_name: &str, cmd: &str, hook_str: &str) -> Result<(), String> {
- let shell = shell::Shell::from_str(shell_name)?;
- let hook = shell::Hook::from_str(hook_str)?;
+ let shell = shell_name.parse::<shell::Shell>()?;
+ let hook = hook_str.parse::<shell::Hook>()?;
let init = shell::ShellInit::new(shell, cmd.to_string(), hook);
@@ -155,11 +154,11 @@ fn handle_switch(branch: &str, internal: bool) -> Result<(), String> {
if internal {
// Internal mode: output directives
// TODO: Implement actual worktree switching logic
- println!("__ARBOR_CD__/tmp/example-worktree");
+ println!("__WORKTRUNK_CD__/tmp/example-worktree");
println!("Switched to worktree: {}", branch);
} else {
println!("Switching to worktree: {}", branch);
- println!("Note: Use 'arbor-switch' (with shell integration) for automatic cd");
+ println!("Note: Use 'wt-switch' (with shell integration) for automatic cd");
}
Ok(())
}
@@ -168,11 +167,11 @@ fn handle_finish(internal: bool) -> Result<(), String> {
if internal {
// Internal mode: output directives
// TODO: Implement actual finish logic
- println!("__ARBOR_CD__/tmp/main-worktree");
+ println!("__WORKTRUNK_CD__/tmp/main-worktree");
println!("Finished worktree and returned to primary");
} else {
println!("Finishing worktree");
- println!("Note: Use 'arbor-finish' (with shell integration) for automatic cd");
+ println!("Note: Use 'wt-finish' (with shell integration) for automatic cd");
}
Ok(())
}
diff --git a/src/shell.rs b/src/shell.rs
index 18d032b20..6462a027d 100644
--- a/src/shell.rs
+++ b/src/shell.rs
@@ -1,5 +1,6 @@
use askama::Template;
use std::fmt;
+use std::str::FromStr;
/// Supported shells
#[derive(Debug, Clone, Copy)]
@@ -9,9 +10,10 @@ pub enum Shell {
Zsh,
}
-impl Shell {
- /// Parse shell name from string
- pub fn from_str(s: &str) -> Result<Self, String> {
+impl FromStr for Shell {
+ type Err = String;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
"bash" => Ok(Shell::Bash),
"fish" => Ok(Shell::Fish),
@@ -40,8 +42,10 @@ pub enum Hook {
Prompt,
}
-impl Hook {
- pub fn from_str(s: &str) -> Result<Self, String> {
+impl FromStr for Hook {
+ type Err = String;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
"none" => Ok(Hook::None),
"prompt" => Ok(Hook::Prompt),
@@ -120,17 +124,17 @@ mod tests {
#[test]
fn test_shell_from_str() {
- assert!(matches!(Shell::from_str("bash"), Ok(Shell::Bash)));
- assert!(matches!(Shell::from_str("BASH"), Ok(Shell::Bash)));
- assert!(matches!(Shell::from_str("fish"), Ok(Shell::Fish)));
- assert!(matches!(Shell::from_str("zsh"), Ok(Shell::Zsh)));
- assert!(Shell::from_str("invalid").is_err());
+ assert!(matches!("bash".parse::<Shell>(), Ok(Shell::Bash)));
+ assert!(matches!("BASH".parse::<Shell>(), Ok(Shell::Bash)));
+ assert!(matches!("fish".parse::<Shell>(), Ok(Shell::Fish)));
+ assert!(matches!("zsh".parse::<Shell>(), Ok(Shell::Zsh)));
+ assert!("invalid".parse::<Shell>().is_err());
}
#[test]
fn test_hook_from_str() {
- assert!(matches!(Hook::from_str("none"), Ok(Hook::None)));
- assert!(matches!(Hook::from_str("prompt"), Ok(Hook::Prompt)));
- assert!(Hook::from_str("invalid").is_err());
+ assert!(matches!("none".parse::<Hook>(), Ok(Hook::None)));
+ assert!(matches!("prompt".parse::<Hook>(), Ok(Hook::Prompt)));
+ assert!("invalid".parse::<Hook>().is_err());
}
}
diff --git a/templates/bash.sh b/templates/bash.sh
index af850e41c..f4c2fcbf3 100644
--- a/templates/bash.sh
+++ b/templates/bash.sh
@@ -1,16 +1,16 @@
-# arbor shell integration for {{ shell_name }}
+# worktrunk shell integration for {{ shell_name }}
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -22,11 +22,11 @@ _arbor_exec() {
# Main commands that support directory changes
{{ cmd_prefix }}-switch() {
- _arbor_exec switch --internal "$@"
+ _wt_exec switch --internal "$@"
}
{{ cmd_prefix }}-finish() {
- _arbor_exec finish --internal "$@"
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
@@ -35,15 +35,15 @@ alias {{ cmd_prefix }}-fin='{{ cmd_prefix }}-finish'
{% if hook.to_string() == "prompt" %}
# Prompt hook for tracking current worktree
-_arbor_prompt_hook() {
- # Call arbor to update tracking
- command arbor hook prompt 2>/dev/null || true
+_wt_prompt_hook() {
+ # Call wt to update tracking
+ command wt hook prompt 2>/dev/null || true
}
# Add to PROMPT_COMMAND
if [[ -z "${PROMPT_COMMAND}" ]]; then
- PROMPT_COMMAND="_arbor_prompt_hook"
+ PROMPT_COMMAND="_wt_prompt_hook"
else
- PROMPT_COMMAND="${PROMPT_COMMAND}; _arbor_prompt_hook"
+ PROMPT_COMMAND="${PROMPT_COMMAND}; _wt_prompt_hook"
fi
{% endif %}
diff --git a/templates/fish.fish b/templates/fish.fish
index eaa821bee..0646a4c7e 100644
--- a/templates/fish.fish
+++ b/templates/fish.fish
@@ -1,15 +1,15 @@
-# arbor shell integration for fish
+# worktrunk shell integration for fish
-# Helper function to parse arbor output and handle directives
-function _arbor_exec
- set -l output (arbor $argv 2>&1)
+# Helper function to parse wt output and handle directives
+function _wt_exec
+ set -l output (wt $argv 2>&1)
set -l exit_code $status
# Parse output line by line
for line in $output
- if string match -q '__ARBOR_CD__*' -- $line
+ if string match -q '__WORKTRUNK_CD__*' -- $line
# Extract path and change directory
- cd (string sub -s 14 -- $line)
+ cd (string sub -s 18 -- $line)
else
# Regular output - print it
echo $line
@@ -21,11 +21,11 @@ end
# Main commands that support directory changes
function {{ cmd_prefix }}-switch
- _arbor_exec switch --internal $argv
+ _wt_exec switch --internal $argv
end
function {{ cmd_prefix }}-finish
- _arbor_exec finish --internal $argv
+ _wt_exec finish --internal $argv
end
# Convenience aliases
@@ -34,8 +34,8 @@ alias {{ cmd_prefix }}-fin='{{ cmd_prefix }}-finish'
{% if hook.to_string() == "prompt" %}
# Prompt hook for tracking current worktree
-function _arbor_prompt_hook --on-event fish_prompt
- # Call arbor to update tracking
- command arbor hook prompt 2>/dev/null; or true
+function _wt_prompt_hook --on-event fish_prompt
+ # Call wt to update tracking
+ command wt hook prompt 2>/dev/null; or true
end
{% endif %}
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index ed9581d9f..f99d07256 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -121,12 +121,14 @@ impl TestRepo {
}
/// Read a file from the repo root
+ #[allow(dead_code)]
pub fn read_file(&self, path: &str) -> String {
std::fs::read_to_string(self.root.join(path))
.unwrap_or_else(|_| panic!("Failed to read {}", path))
}
/// List all files in the repository (excluding .git)
+ #[allow(dead_code)]
pub fn file_tree(&self) -> Vec<String> {
let mut files = Vec::new();
self.collect_files(&self.root, "", &mut files);
@@ -134,6 +136,7 @@ impl TestRepo {
files
}
+ #[allow(clippy::only_used_in_recursion)]
fn collect_files(&self, dir: &Path, prefix: &str, files: &mut Vec<String>) {
if let Ok(entries) = std::fs::read_dir(dir) {
for entry in entries.flatten() {
@@ -320,6 +323,7 @@ impl TestRepo {
}
/// Get the path to the remote repository if one was set up
+ #[allow(dead_code)]
pub fn remote_path(&self) -> Option<&Path> {
self.remote.as_deref()
}
diff --git a/tests/integration_tests/default_branch.rs b/tests/integration_tests/default_branch.rs
index 28897f9b3..1fee011bb 100644
--- a/tests/integration_tests/default_branch.rs
+++ b/tests/integration_tests/default_branch.rs
@@ -10,7 +10,7 @@ fn test_get_default_branch_with_origin_head() {
assert!(repo.has_origin_head());
// Test that we can get the default branch
- let branch = arbor::git::get_default_branch_in(&repo.root_path())
+ let branch = worktrunk::git::get_default_branch_in(repo.root_path())
.expect("Failed to get default branch");
assert_eq!(branch, "main");
}
@@ -26,7 +26,7 @@ fn test_get_default_branch_without_origin_head() {
assert!(!repo.has_origin_head());
// Should still work by querying remote
- let branch = arbor::git::get_default_branch_in(&repo.root_path())
+ let branch = worktrunk::git::get_default_branch_in(repo.root_path())
.expect("Failed to get default branch");
assert_eq!(branch, "main");
@@ -45,12 +45,12 @@ fn test_get_default_branch_caches_result() {
assert!(!repo.has_origin_head());
// First call queries remote and caches
- arbor::git::get_default_branch_in(&repo.root_path())
+ worktrunk::git::get_default_branch_in(repo.root_path())
.expect("Failed to get default branch");
assert!(repo.has_origin_head());
// Second call uses cache (fast path)
- let branch = arbor::git::get_default_branch_in(&repo.root_path())
+ let branch = worktrunk::git::get_default_branch_in(repo.root_path())
.expect("Failed to get default branch on second call");
assert_eq!(branch, "main");
}
@@ -61,6 +61,6 @@ fn test_get_default_branch_no_remote() {
repo.commit("Initial commit");
// No remote configured, should fail
- let result = arbor::git::get_default_branch_in(&repo.root_path());
+ let result = worktrunk::git::get_default_branch_in(repo.root_path());
assert!(result.is_err());
}
diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rs
index 8d7711a1b..b4c1b7464 100644
--- a/tests/integration_tests/directives.rs
+++ b/tests/integration_tests/directives.rs
@@ -13,10 +13,10 @@ fn test_switch_internal_directive() {
settings.set_snapshot_path("../snapshots");
// Normalize the directive path output
- settings.add_filter(r"__ARBOR_CD__[^\n]+", "__ARBOR_CD__[PATH]");
+ settings.add_filter(r"__WORKTRUNK_CD__[^\n]+", "__WORKTRUNK_CD__[PATH]");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("switch")
.arg("my-feature")
@@ -37,7 +37,7 @@ fn test_switch_without_internal() {
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("switch")
.arg("my-feature")
@@ -57,10 +57,10 @@ fn test_finish_internal_directive() {
settings.set_snapshot_path("../snapshots");
// Normalize the directive path output
- settings.add_filter(r"__ARBOR_CD__[^\n]+", "__ARBOR_CD__[PATH]");
+ settings.add_filter(r"__WORKTRUNK_CD__[^\n]+", "__WORKTRUNK_CD__[PATH]");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("finish")
.arg("--internal")
@@ -80,7 +80,7 @@ fn test_finish_without_internal() {
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("finish").current_dir(repo.root_path());
diff --git a/tests/integration_tests/init.rs b/tests/integration_tests/init.rs
index 3a74f51d4..e93407b33 100644
--- a/tests/integration_tests/init.rs
+++ b/tests/integration_tests/init.rs
@@ -10,7 +10,7 @@ fn snapshot_init(test_name: &str, shell: &str, extra_args: &[&str]) {
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("init").arg(shell);
@@ -70,7 +70,7 @@ fn test_init_invalid_shell() {
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("init")
.arg("invalid-shell")
@@ -87,7 +87,7 @@ fn test_init_invalid_hook() {
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
repo.clean_cli_env(&mut cmd);
cmd.arg("init")
.arg("bash")
diff --git a/tests/integration_tests/list.rs b/tests/integration_tests/list.rs
index 9052a8383..a8045fdf5 100644
--- a/tests/integration_tests/list.rs
+++ b/tests/integration_tests/list.rs
@@ -13,7 +13,7 @@ fn snapshot_list(test_name: &str, repo: &TestRepo) {
for (name, path) in &repo.worktrees {
settings.add_filter(
path.to_str().unwrap(),
- &format!("[WORKTREE_{}]", name.to_uppercase().replace('-', "_")),
+ format!("[WORKTREE_{}]", name.to_uppercase().replace('-', "_")),
);
}
@@ -24,7 +24,7 @@ fn snapshot_list(test_name: &str, repo: &TestRepo) {
settings.add_filter(r"\\", "/");
settings.bind(|| {
- let mut cmd = Command::new(get_cargo_bin("arbor"));
+ let mut cmd = Command::new(get_cargo_bin("wt"));
// Clean environment to avoid interference from global git config
repo.clean_cli_env(&mut cmd);
cmd.arg("list").current_dir(repo.root_path());
diff --git a/tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snap b/tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snap
index 73211ba2d..2b1e8d38b 100644
--- a/tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snap
+++ b/tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/directives.rs
info:
- program: arbor
+ program: wt
args:
- finish
- "--internal"
@@ -18,7 +18,7 @@ info:
success: true
exit_code: 0
----- stdout -----
-__ARBOR_CD__[PATH]
+__WORKTRUNK_CD__[PATH]
Finished worktree and returned to primary
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__directives__finish_without_internal.snap b/tests/snapshots/integration__integration_tests__directives__finish_without_internal.snap
index 4951d1e59..31453382f 100644
--- a/tests/snapshots/integration__integration_tests__directives__finish_without_internal.snap
+++ b/tests/snapshots/integration__integration_tests__directives__finish_without_internal.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/directives.rs
info:
- program: arbor
+ program: wt
args:
- finish
env:
@@ -18,6 +18,6 @@ success: true
exit_code: 0
----- stdout -----
Finishing worktree
-Note: Use 'arbor-finish' (with shell integration) for automatic cd
+Note: Use 'wt-finish' (with shell integration) for automatic cd
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap b/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap
index 356b7d74d..4df8ae284 100644
--- a/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap
+++ b/tests/snapshots/integration__integration_tests__directives__switch_internal_directive.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/directives.rs
info:
- program: arbor
+ program: wt
args:
- switch
- my-feature
@@ -19,7 +19,7 @@ info:
success: true
exit_code: 0
----- stdout -----
-__ARBOR_CD__[PATH]
+__WORKTRUNK_CD__[PATH]
Switched to worktree: my-feature
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap b/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap
index fc294d7cd..6a9d2b6fc 100644
--- a/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap
+++ b/tests/snapshots/integration__integration_tests__directives__switch_without_internal.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/directives.rs
info:
- program: arbor
+ program: wt
args:
- switch
- my-feature
@@ -19,6 +19,6 @@ success: true
exit_code: 0
----- stdout -----
Switching to worktree: my-feature
-Note: Use 'arbor-switch' (with shell integration) for automatic cd
+Note: Use 'wt-switch' (with shell integration) for automatic cd
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index ec5b8d5af..9f0adf346 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- bash
@@ -18,19 +18,19 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for bash
+# worktrunk shell integration for bash
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -41,17 +41,17 @@ _arbor_exec() {
}
# Main commands that support directory changes
-arbor-switch() {
- _arbor_exec switch --internal "$@"
+wt-switch() {
+ _wt_exec switch --internal "$@"
}
-arbor-finish() {
- _arbor_exec finish --internal "$@"
+wt-finish() {
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
-alias arbor-sw='arbor-switch'
-alias arbor-fin='arbor-finish'
+alias wt-sw='wt-switch'
+alias wt-fin='wt-finish'
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap b/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap
index d3186835c..54a0f6c1f 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- bash
@@ -22,19 +22,19 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for bash
+# worktrunk shell integration for bash
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -46,11 +46,11 @@ _arbor_exec() {
# Main commands that support directory changes
wt-switch() {
- _arbor_exec switch --internal "$@"
+ _wt_exec switch --internal "$@"
}
wt-finish() {
- _arbor_exec finish --internal "$@"
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
@@ -59,16 +59,16 @@ alias wt-fin='wt-finish'
# Prompt hook for tracking current worktree
-_arbor_prompt_hook() {
- # Call arbor to update tracking
- command arbor hook prompt 2>/dev/null || true
+_wt_prompt_hook() {
+ # Call wt to update tracking
+ command wt hook prompt 2>/dev/null || true
}
# Add to PROMPT_COMMAND
if [[ -z "${PROMPT_COMMAND}" ]]; then
- PROMPT_COMMAND="_arbor_prompt_hook"
+ PROMPT_COMMAND="_wt_prompt_hook"
else
- PROMPT_COMMAND="${PROMPT_COMMAND}; _arbor_prompt_hook"
+ PROMPT_COMMAND="${PROMPT_COMMAND}; _wt_prompt_hook"
fi
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 f8848abbc..515ef5ff8 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
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- bash
@@ -20,19 +20,19 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for bash
+# worktrunk shell integration for bash
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -44,11 +44,11 @@ _arbor_exec() {
# Main commands that support directory changes
wt-switch() {
- _arbor_exec switch --internal "$@"
+ _wt_exec switch --internal "$@"
}
wt-finish() {
- _arbor_exec finish --internal "$@"
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap b/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap
index 4734ed7ab..806afaa4a 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- bash
@@ -20,19 +20,19 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for bash
+# worktrunk shell integration for bash
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -43,30 +43,30 @@ _arbor_exec() {
}
# Main commands that support directory changes
-arbor-switch() {
- _arbor_exec switch --internal "$@"
+wt-switch() {
+ _wt_exec switch --internal "$@"
}
-arbor-finish() {
- _arbor_exec finish --internal "$@"
+wt-finish() {
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
-alias arbor-sw='arbor-switch'
-alias arbor-fin='arbor-finish'
+alias wt-sw='wt-switch'
+alias wt-fin='wt-finish'
# Prompt hook for tracking current worktree
-_arbor_prompt_hook() {
- # Call arbor to update tracking
- command arbor hook prompt 2>/dev/null || true
+_wt_prompt_hook() {
+ # Call wt to update tracking
+ command wt hook prompt 2>/dev/null || true
}
# Add to PROMPT_COMMAND
if [[ -z "${PROMPT_COMMAND}" ]]; then
- PROMPT_COMMAND="_arbor_prompt_hook"
+ PROMPT_COMMAND="_wt_prompt_hook"
else
- PROMPT_COMMAND="${PROMPT_COMMAND}; _arbor_prompt_hook"
+ PROMPT_COMMAND="${PROMPT_COMMAND}; _wt_prompt_hook"
fi
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 50f278f61..81a52705f 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- fish
@@ -18,18 +18,18 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for fish
+# worktrunk shell integration for fish
-# Helper function to parse arbor output and handle directives
-function _arbor_exec
- set -l output (arbor $argv 2>&1)
+# Helper function to parse wt output and handle directives
+function _wt_exec
+ set -l output (wt $argv 2>&1)
set -l exit_code $status
# Parse output line by line
for line in $output
- if string match -q '__ARBOR_CD__*' -- $line
+ if string match -q '__WORKTRUNK_CD__*' -- $line
# Extract path and change directory
- cd (string sub -s 14 -- $line)
+ cd (string sub -s 18 -- $line)
else
# Regular output - print it
echo $line
@@ -40,17 +40,17 @@ function _arbor_exec
end
# Main commands that support directory changes
-function arbor-switch
- _arbor_exec switch --internal $argv
+function wt-switch
+ _wt_exec switch --internal $argv
end
-function arbor-finish
- _arbor_exec finish --internal $argv
+function wt-finish
+ _wt_exec finish --internal $argv
end
# Convenience aliases
-alias arbor-sw='arbor-switch'
-alias arbor-fin='arbor-finish'
+alias wt-sw='wt-switch'
+alias wt-fin='wt-finish'
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap b/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap
index 2d121325e..4e40d5175 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- fish
@@ -20,18 +20,18 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for fish
+# worktrunk shell integration for fish
-# Helper function to parse arbor output and handle directives
-function _arbor_exec
- set -l output (arbor $argv 2>&1)
+# Helper function to parse wt output and handle directives
+function _wt_exec
+ set -l output (wt $argv 2>&1)
set -l exit_code $status
# Parse output line by line
for line in $output
- if string match -q '__ARBOR_CD__*' -- $line
+ if string match -q '__WORKTRUNK_CD__*' -- $line
# Extract path and change directory
- cd (string sub -s 14 -- $line)
+ cd (string sub -s 18 -- $line)
else
# Regular output - print it
echo $line
@@ -42,23 +42,23 @@ function _arbor_exec
end
# Main commands that support directory changes
-function arbor-switch
- _arbor_exec switch --internal $argv
+function wt-switch
+ _wt_exec switch --internal $argv
end
-function arbor-finish
- _arbor_exec finish --internal $argv
+function wt-finish
+ _wt_exec finish --internal $argv
end
# Convenience aliases
-alias arbor-sw='arbor-switch'
-alias arbor-fin='arbor-finish'
+alias wt-sw='wt-switch'
+alias wt-fin='wt-finish'
# Prompt hook for tracking current worktree
-function _arbor_prompt_hook --on-event fish_prompt
- # Call arbor to update tracking
- command arbor hook prompt 2>/dev/null; or true
+function _wt_prompt_hook --on-event fish_prompt
+ # Call wt to update tracking
+ command wt hook prompt 2>/dev/null; or true
end
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index 18babaacb..025457086 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -1,7 +1,7 @@
---
source: tests/integration_tests/init.rs
info:
- program: arbor
+ program: wt
args:
- init
- zsh
@@ -18,19 +18,19 @@ info:
success: true
exit_code: 0
----- stdout -----
-# arbor shell integration for zsh
+# worktrunk shell integration for zsh
-# Helper function to parse arbor output and handle directives
-_arbor_exec() {
+# Helper function to parse wt output and handle directives
+_wt_exec() {
local output line exit_code
- output="$("arbor" "$@" 2>&1)"
+ output="$("wt" "$@" 2>&1)"
exit_code=$?
# Parse output line by line
while IFS= read -r line; do
- if [[ "$line" == __ARBOR_CD__* ]]; then
+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then
# Extract path and change directory
- \cd "${line#__ARBOR_CD__}"
+ \cd "${line#__WORKTRUNK_CD__}"
else
# Regular output - print it
echo "$line"
@@ -41,17 +41,17 @@ _arbor_exec() {
}
# Main commands that support directory changes
-arbor-switch() {
- _arbor_exec switch --internal "$@"
+wt-switch() {
+ _wt_exec switch --internal "$@"
}
-arbor-finish() {
- _arbor_exec finish --internal "$@"
+wt-finish() {
+ _wt_exec finish --internal "$@"
}
# Convenience aliases
-alias arbor-sw='arbor-switch'
-alias arbor-fin='arbor-finish'
+alias wt-sw='wt-switch'
+alias wt-fin='wt-finish'