Skip to content

Commit 7d37e0a

Browse files
committed
docs(todo): correct cross cd vs wt command design intent
Clarify that cd and wt are separate commands with different purposes: - cross wt → goes to WORKTREE (.git/cross/worktrees/) for git history - cross cd → should go to LOCAL_PATH (patched dir) for editing files Current bug: cd is doing what wt does (going to worktree) Remove P3 entry based on misunderstanding (no --local flag needed, they are distinct commands by design).
1 parent 4c0629d commit 7d37e0a

File tree

1 file changed

+21
-36
lines changed

1 file changed

+21
-36
lines changed

TODO.md

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

5454
### P2: Lower Priority
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
55+
- [ ] **Fix `cross cd` command** - Should target local_path, not worktree
56+
- **Issue:** Currently `cross cd` changes to WORKTREE directory (`.git/cross/worktrees/`), but it should change to LOCAL_PATH
57+
- **Design Intent:**
58+
- `cross wt [path]` → changes to WORKTREE (`.git/cross/worktrees/`) - for working with git history
59+
- `cross cd [path]` → changes to LOCAL_PATH (patched directory in main repo) - for editing files
60+
- These are **separate commands with different purposes**, not one command with flags
61+
- **Current Bug:**
62+
- `cross cd` is doing what `wt` should do (going to worktree)
63+
- `cross cd` needs to be fixed to target local_path instead
5764
- **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)
65+
- `cross cd [path]`outputs LOCAL_PATH for the patch
66+
- `cross cd` (no args) → uses fzf to list and select from local_paths
6067
- Output path only (no subshell) → Enable pattern: `cd $(cross cd <patch>)`
6168
- **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
69+
- Justfile (lines 761-797): Goes to worktree (WRONG - should go to local_path)
70+
- Go (lines 681-730): Goes to worktree (WRONG - should go to local_path)
71+
- Rust: Same behavior (WRONG - should go to local_path)
72+
- `wt` command: Correctly goes to worktree - can reuse fzf pattern for `cd`
6673
- **Required Changes:**
67-
- Change target from worktree_path to local_path
68-
- Add fzf selection when no path provided (reuse from `wt` command)
74+
- Change `cd` command target from worktree_path to local_path
75+
- Keep `wt` command as-is (it's correct)
76+
- Add fzf selection to `cd` when no path provided (reuse from `wt`)
6977
- Output path string instead of opening subshell
7078
- **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
79+
- **Files:** `Justfile.cross`, `src-go/main.go`, `src-rust/src/main.rs`, `test/017_cd_fix.sh`
80+
- **Impact:** HIGH - Fixes incorrect behavior, makes commands work as designed
81+
- **Status:** Not yet implemented - current behavior is buggy
7482

7583
- [ ] **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".
7684
- **Effort:** 4-6 hours (includes research)
@@ -124,29 +132,6 @@
124132
- **Priority Rationale:** Low priority - UX improvement, not a bug
125133
- **Status:** Documented for future implementation
126134

127-
- [ ] **Add `cross cd` to local_path capability** - Currently only changes to worktree
128-
- **Issue:** `cross cd` currently opens a shell in the WORKTREE (hidden `.git/cross/worktrees/`)
129-
- **Desired Behavior:**
130-
- Provide ability to change directory to LOCAL_PATH (the actual patched directory in main repo)
131-
- Options:
132-
1. Add `--local` flag: `cross cd --local [patch]` → changes to local_path
133-
2. Add separate command: `cross path [patch]` → outputs local_path for use with shell `cd $(cross path patch)`
134-
3. Make `cd` default to local_path, add `--worktree` flag for old behavior (covered in P2 refactor)
135-
- **Current Implementation:**
136-
- Justfile (lines 761-797): `cd` target opens shell in worktree directory
137-
- Go (lines 681-730): Same behavior - opens shell in worktree
138-
- Rust: Similar behavior
139-
- **Relationship to P2 Task:**
140-
- P2 refactor will change default behavior to local_path
141-
- This task documents alternative approaches (flags, separate command)
142-
- May be resolved by P2 implementation or kept as additional options
143-
- **Effort:** 2-3 hours
144-
- **Files:** `Justfile.cross`, `src-go/main.go`, `src-rust/src/main.rs`, `test/017_cd_local.sh`
145-
- **Complexity:** LOW - Add path resolution and output logic
146-
- **Impact:** MEDIUM - Improves workflow for users editing patched files
147-
- **Priority Rationale:** Low priority - workaround exists (manually navigate to patch), P2 refactor may address this
148-
- **Status:** Not yet implemented, may be covered by P2 refactor
149-
150135
### Completed Enhancements
151136

152137
## Known Issues (To FIX)

0 commit comments

Comments
 (0)