Skip to content

Commit 4e22867

Browse files
committed
chore(release): prepare v0.2.1 release
- Update VERSION to 0.2.1 - Update CHANGELOG.md with comprehensive v0.2.1 release notes - Update README.md version badge to 0.2.1 - Update TODO.md status (critical issues: 0) - Add P2 task: refactor cross cd to target local_path (currently targets worktree incorrectly) - Add P3 known issue: context-aware cross diff command - Update src-go/main.go cobra version to 0.2.1 - Update src-rust versions to 0.2.1 New Features: - cross prune command for interactive cleanup - Interactive remote removal with confirmation Bug Fixes: - Sync preserves untracked local files - File deletion only for tracked files (git ls-files) - Complete stash/restore workflow in sync All implementations tested and building successfully.
1 parent 8b2ed8b commit 4e22867

File tree

8 files changed

+112
-8
lines changed

8 files changed

+112
-8
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.1] - 2026-01-06
11+
12+
### Added
13+
- **`prune` command** - Clean up unused remotes and stale worktrees
14+
- `cross prune`: Interactive removal of remotes with no active patches
15+
- `cross prune <remote>`: Remove all patches for a specific remote
16+
- Excludes 'origin' and 'git-cross' from cleanup
17+
- Runs `git worktree prune` to clean stale worktrees
18+
- Implemented across all three implementations (Just, Go, Rust)
19+
- Full test coverage in `test/015_prune.sh`
20+
21+
### Fixed
22+
- **Sync command file deletion logic** - Only delete tracked files removed upstream
23+
- Previously would delete ALL files including user's untracked customizations
24+
- Now uses `git ls-files` to only check tracked files
25+
- Preserves untracked local files (config files, notes, etc.)
26+
- Fixes data loss risk for local customizations in patched directories
27+
- **Sync command data preservation** - Complete stash/restore workflow
28+
- Preserves uncommitted changes during sync operations
29+
- Handles untracked files properly with `--include-untracked`
30+
- Detects and removes files deleted upstream
31+
- Graceful conflict handling with user feedback
32+
33+
### Changed
34+
- **Agent guidelines** - Added critical implementation requirements in AGENTS.md
35+
- All three implementations must be updated together
36+
- No partial commits allowed
37+
- Test coverage required for all features
38+
- Command parity must be maintained
39+
40+
### Testing
41+
- Enhanced `test/004_sync.sh` with 6 comprehensive scenarios
42+
- Added `test/015_prune.sh` with 3 test scenarios
43+
- All tests pass for Just, Go, and Rust implementations
44+
1045
## [0.2.0] - 2025-12-01
1146

1247
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![CI](https://github.com/epcim/git-cross/workflows/CI/badge.svg)](https://github.com/epcim/git-cross/actions/workflows/ci.yml)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![Version](https://img.shields.io/badge/version-0.2.0-blue.svg)](https://github.com/epcim/git-cross/blob/main/CHANGELOG.md)
5+
[![Version](https://img.shields.io/badge/version-0.2.1-blue.svg)](https://github.com/epcim/git-cross/blob/main/CHANGELOG.md)
66

77
**Git's CRISPR.** Minimalist approach for mixing "parts" of git repositories using `git worktree` + `rsync`.
88

TODO.md

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Summary
44

5-
**Status:** v0.2.0 released with feature parity across implementations
6-
**Critical Issues:** 1 (sync data loss)
7-
**Pending Enhancements:** 4 (prune, cd, single-file patch, fzf improvements)
5+
**Status:** v0.2.1 released with prune command and sync fixes
6+
**Critical Issues:** 0 (all P0 issues resolved)
7+
**Pending Enhancements:** 3 (cd refactor, single-file patch, fzf improvements)
88

99
## Core Implementation Status
1010

@@ -61,6 +61,71 @@
6161
- [ ] **Improve interactive `fzf` selection** in native implementations - Better UI, preview panes, multi-select for batch operations.
6262
- **Effort:** 3-5 hours
6363

64+
### P3: Low Priority (UX Improvements)
65+
66+
- [ ] **Context-aware `cross diff` command** - Smart diff behavior based on current working directory
67+
- **Issue:** Currently `cross diff` shows diffs for ALL patches regardless of PWD
68+
- **Desired Behavior:**
69+
- When executed inside a patched local_path: Show diff only for that specific patch
70+
- When executed outside any patch (anywhere in repo): Show diffs for all patches
71+
- When given explicit path argument: Show diff for that specific patch with informative header
72+
- **Effort:** 4-6 hours (includes complexity analysis and implementation)
73+
- **Files:** `Justfile.cross`, `src-go/main.go`, `src-rust/src/main.rs`, `test/016_diff_context.sh`
74+
- **Complexity Analysis Required:**
75+
- **Current Implementation:**
76+
- Justfile: Uses `_resolve_context2` to resolve patch from path/PWD (lines 578-592)
77+
- Go: Iterates all patches, filters by explicit path arg only (lines 880-911)
78+
- Rust: Same as Go - no PWD detection (lines 1194-1214)
79+
- **Required Changes:**
80+
- **Low complexity** for Justfile (already has PWD resolution via `_resolve_context2`)
81+
- **Medium complexity** for Go/Rust (need to add PWD detection logic)
82+
- Need to add: Get PWD → Check if inside patch → Filter patches accordingly
83+
- **Implementation Strategy:**
84+
1. Detect current working directory relative to repo root
85+
2. Check if CWD is within any patch's local_path
86+
3. Filter patches based on context:
87+
- If inside patch + no explicit arg → show only that patch
88+
- If outside patches + no explicit arg → show all patches
89+
- If explicit arg provided → show only that patch (current behavior)
90+
4. Add informative header: "Diff for patch: {local_path}" when contextual
91+
- **Impact Assessment:**
92+
- **User Experience:** HIGH - More intuitive, reduces noise
93+
- **Breaking Changes:** NONE - Backwards compatible (explicit args work same)
94+
- **Code Complexity:** LOW to MEDIUM
95+
- Justfile: ~10-15 lines (reuse existing `_resolve_context2`)
96+
- Go: ~20-30 lines (add `getCurrentPath()` helper)
97+
- Rust: ~20-30 lines (add `get_current_path()` helper)
98+
- **Testing:** MEDIUM - Need scenarios for:
99+
1. Diff from inside patch (should show only that patch)
100+
2. Diff from outside patches (should show all)
101+
3. Diff with explicit arg (should show specified patch)
102+
4. Diff from nested subdirectory within patch (should resolve parent patch)
103+
- **Edge Cases:**
104+
- CWD inside nested subdirectory of patch (needs parent resolution)
105+
- Multiple patches in nested directories (resolve closest parent)
106+
- Symlinked directories (should follow symlinks)
107+
- **Priority Rationale:** Low priority - UX improvement, not a bug
108+
- **Status:** Documented for future implementation
109+
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+
64129
### Completed Enhancements
65130

66131
## Known Issues (To FIX)

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.2.1

src-go/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ func selectPatchInteractive(meta *Metadata) (*Patch, error) {
364364

365365
func main() {
366366
var dry string
367-
rootCmd := &cobra.Command{Use: "git-cross"}
367+
rootCmd := &cobra.Command{
368+
Use: "git-cross",
369+
Version: "0.2.1",
370+
}
368371
rootCmd.PersistentFlags().StringVar(&dry, "dry", "", "Dry run command (e.g. echo)")
369372

370373
useCmd := &cobra.Command{

src-rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "git-cross-rust"
3-
version = "0.1.0"
3+
version = "0.2.1"
44
edition = "2024"
55

66
[dependencies]

src-rust/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tabled::{Table, Tabled};
1010

1111
#[derive(Parser)]
1212
#[command(name = "git-cross-rust")]
13-
#[command(version = "0.1.0")]
13+
#[command(version = "0.2.1")]
1414
#[command(
1515
about = "A tool for vendoring git directories using worktrees [EXPERIMENTAL/WIP]",
1616
long_about = "Note: The Rust implementation of git-cross is currently EXPERIMENTAL and WORK IN PROGRESS. The Go implementation is the primary focus and recommended for production use."

0 commit comments

Comments
 (0)