@@ -54,6 +54,7 @@ cargo check --all-features
5454cargo doc --no-deps --open
5555```
5656
57+
5758### Installation
5859
5960``` bash
@@ -67,13 +68,25 @@ cargo install --path .
6768source /path/to/git-workers/shell/gw.sh
6869```
6970
71+ ## Recent Changes
72+
73+ ### Branch Option Simplification
74+ - Reduced from 3 options to 2: "Create from current HEAD" and "Select branch (smart mode)"
75+ - Smart mode automatically handles branch conflicts and offers appropriate actions
76+
77+ ### Key Methods Added/Modified
78+ - ** ` get_branch_worktree_map() ` ** : Maps branch names to worktree names, including main worktree detection
79+ - ** ` list_all_branches() ` ** : Returns both local and remote branches (remote without "origin/" prefix)
80+ - ** ` create_worktree_with_new_branch() ` ** : Creates worktree with new branch from base branch (supports git-flow style workflows)
81+
7082## Architecture
7183
7284### Core Module Structure
7385
7486```
7587src/
7688├── main.rs # CLI entry point and main menu loop
89+ ├── lib.rs # Library exports
7790├── commands.rs # Command implementations for menu items
7891├── git.rs # Git worktree operations (git2 + process::Command)
7992├── menu.rs # MenuItem enum and icon definitions
@@ -114,12 +127,14 @@ post-switch = ["echo 'Switched to {{worktree_name}}'"]
114127```
115128
116129Template variables:
130+
117131- ` {{worktree_name}} ` : The worktree name
118132- ` {{worktree_path}} ` : Absolute path to worktree
119133
120134### Worktree Patterns
121135
122136First worktree creation offers two options:
137+
1231381 . Same level as repository: ` ../worktree-name `
1241392 . In subdirectory (recommended): ` ../repo/worktrees/worktree-name `
125140
@@ -128,13 +143,15 @@ Subsequent worktrees follow the established pattern automatically.
128143### ESC Key Handling
129144
130145All interactive prompts support ESC cancellation through custom ` input_esc_raw ` module:
146+
131147- ` input_esc_raw() ` returns ` Option<String> ` (None on ESC)
132148- ` Select::interact_opt() ` for menu selections
133149- ` Confirm::interact_opt() ` for confirmations
134150
135151### Worktree Rename Implementation
136152
137153Since Git lacks native rename functionality:
154+
1381551 . Move directory with ` fs::rename `
1391562 . Update ` .git/worktrees/<name> ` metadata directory
1401573 . Update gitdir files in both directions
@@ -149,9 +166,11 @@ Since Git lacks native rename functionality:
149166
150167### Testing Considerations
151168
169+ - Integration tests in ` tests/ ` directory (27 test files)
152170- Some tests are flaky in parallel execution (marked with ` #[ignore] ` )
153171- CI sets ` CI=true ` environment variable to skip flaky tests
154172- Run with ` --test-threads=1 ` for reliable results
173+ - Use ` --nocapture ` to see test output for debugging
155174
156175### Important Constraints
157176
@@ -161,3 +180,4 @@ Since Git lacks native rename functionality:
161180- Cannot rename worktrees with detached HEAD
162181- Shell integration supports Bash/Zsh only
163182- No Windows support (macOS and Linux only)
183+ - Recent breaking change: CLI arguments removed in favor of menu-only interface
0 commit comments