Skip to content

Commit 6c8d1ff

Browse files
committed
docs(todo): clarify cross cd refactor task with detailed requirements
- Expand P2 cross cd task with complete issue description - Document current incorrect behavior (targets worktree, should target local_path) - Add desired behavior: fzf selection when no args, output path only - Remove duplicate entry from P3 section - Mark as HIGH impact (fixes incorrect behavior) - Reference wt command as working example to reuse
1 parent 4e22867 commit 6c8d1ff

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

TODO.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,25 @@
5252
- **Status:** COMPLETE - Ready for v0.2.1 release
5353

5454
### P2: Lower Priority
55-
- [ ] **Refactor `cross cd`** - Target local patched folder and output path (no subshell), supporting fzf. Enable pattern: `cd $(cross cd <patch>)`
55+
- [ ] **Refactor `cross cd`** - Target local patched folder (not worktree) and output path (no subshell), supporting fzf
56+
- **Issue:** Currently `cross cd` changes to WORKTREE directory (`.git/cross/worktrees/`), which is incorrect
57+
- **Desired Behavior:**
58+
- `cross cd [path]` → changes to LOCAL_PATH (the actual patched directory in main repo)
59+
- `cross cd` (no args) → uses fzf to list and select from local_paths (same as `wt` command implementation)
60+
- Output path only (no subshell) → Enable pattern: `cd $(cross cd <patch>)`
61+
- **Current Implementation:**
62+
- Justfile (lines 761-797): Opens shell in worktree directory (WRONG)
63+
- Go (lines 681-730): Opens shell in worktree directory (WRONG)
64+
- Rust: Same behavior (WRONG)
65+
- `wt` command: Already has fzf selection working correctly - can reuse this pattern
66+
- **Required Changes:**
67+
- Change target from worktree_path to local_path
68+
- Add fzf selection when no path provided (reuse from `wt` command)
69+
- Output path string instead of opening subshell
5670
- **Effort:** 2-3 hours
71+
- **Files:** `Justfile.cross`, `src-go/main.go`, `src-rust/src/main.rs`, `test/017_cd_refactor.sh`
72+
- **Impact:** HIGH - Fixes incorrect behavior, improves UX significantly
73+
- **Status:** Not yet implemented - current behavior is incorrect
5774

5875
- [ ] **Single file patch capability** - Review and propose implementation (tool and test) to be able to patch even single file. If not easily possible without major refactoring, evaluate new command "patch-file".
5976
- **Effort:** 4-6 hours (includes research)
@@ -107,25 +124,6 @@
107124
- **Priority Rationale:** Low priority - UX improvement, not a bug
108125
- **Status:** Documented for future implementation
109126

110-
- [ ] **Add `cross cd` to local_path capability** - Currently only changes to worktree
111-
- **Issue:** `cross cd` currently opens a shell in the WORKTREE (hidden `.git/cross/worktrees/`)
112-
- **Desired Behavior:**
113-
- Provide ability to change directory to LOCAL_PATH (the actual patched directory in main repo)
114-
- Options:
115-
1. Add `--local` flag: `cross cd --local [patch]` → changes to local_path
116-
2. Add separate command: `cross path [patch]` → outputs local_path for use with shell `cd $(cross path patch)`
117-
3. Make `cd` default to local_path, add `--worktree` flag for old behavior
118-
- **Current Implementation:**
119-
- Justfile (lines 761-797): `cd` target opens shell in worktree directory
120-
- Go (lines 681-730): Same behavior - opens shell in worktree
121-
- Rust: Similar behavior
122-
- **Effort:** 2-3 hours
123-
- **Files:** `Justfile.cross`, `src-go/main.go`, `src-rust/src/main.rs`, `test/017_cd_local.sh`
124-
- **Complexity:** LOW - Just need to add path resolution and output logic
125-
- **Impact:** MEDIUM - Improves workflow for users editing patched files
126-
- **Priority Rationale:** Low priority - workaround exists (manually navigate to patch), but UX improvement
127-
- **Status:** Not yet implemented, documented for future consideration
128-
129127
### Completed Enhancements
130128

131129
## Known Issues (To FIX)

0 commit comments

Comments
 (0)