|
| 1 | +# Rustic Git - Development Plan |
| 2 | + |
| 3 | +## Current Status |
| 4 | + |
| 5 | +✅ **Completed Core Features** |
| 6 | +- Repository initialization and opening |
| 7 | +- Enhanced file status checking with staged/unstaged tracking |
| 8 | +- Staging operations (add, add_all, add_update) |
| 9 | +- Commit operations with custom authors |
| 10 | +- Branch operations (create, checkout, delete, list) |
| 11 | +- Configuration management (user settings, repository config) |
| 12 | +- Commit history and log operations with filtering |
| 13 | +- Error handling with comprehensive GitError types |
| 14 | +- Cross-platform compatibility (OS-agnostic temp directories) |
| 15 | +- **Remote management with full CRUD operations** |
| 16 | +- **Network operations (fetch, push, clone) with advanced options** |
| 17 | +- **File lifecycle operations (restore, reset, remove, move, .gitignore management)** |
| 18 | + |
| 19 | +## ✅ Phase 1: Essential Remote Operations (COMPLETED) |
| 20 | + |
| 21 | +### ✅ Remote Management |
| 22 | +- [x] `repo.add_remote(name, url)` - Add remote repository |
| 23 | +- [x] `repo.remove_remote(name)` - Remove remote |
| 24 | +- [x] `repo.list_remotes()` - List all remotes with URLs |
| 25 | +- [x] `repo.rename_remote(old_name, new_name)` - Rename remote |
| 26 | +- [x] `repo.get_remote_url(name)` - Get remote URL |
| 27 | + |
| 28 | +### ✅ Network Operations |
| 29 | +- [x] `repo.fetch(remote)` / `repo.fetch_with_options()` - Fetch from remotes |
| 30 | +- [x] `repo.push(remote, branch)` / `repo.push_with_options()` - Push changes |
| 31 | +- [x] `repo.clone(url, path)` - Clone repository (static method) |
| 32 | +- [x] Advanced options with FetchOptions and PushOptions |
| 33 | +- [x] Type-safe builder patterns for network operations |
| 34 | + |
| 35 | +## ✅ Phase 2: File Lifecycle Operations (COMPLETED) |
| 36 | + |
| 37 | +### ✅ File Management |
| 38 | +- [x] `repo.checkout_file(path)` - Restore file from HEAD |
| 39 | +- [x] `repo.reset_file(path)` - Unstage specific file |
| 40 | +- [x] `repo.rm(paths)` - Remove files from repository |
| 41 | +- [x] `repo.rm_with_options(paths, options)` - Remove with advanced options |
| 42 | +- [x] `repo.mv(from, to)` - Move/rename files in repository |
| 43 | +- [x] `repo.mv_with_options(source, dest, options)` - Move with advanced options |
| 44 | +- [x] `repo.restore(paths, options)` - Restore files from specific commit with advanced options |
| 45 | + |
| 46 | +### ✅ Ignore Management |
| 47 | +- [x] `repo.ignore_add(patterns)` - Add patterns to .gitignore |
| 48 | +- [x] `repo.ignore_check(file)` - Check if file is ignored |
| 49 | +- [x] `repo.ignore_list()` - List current ignore patterns |
| 50 | + |
| 51 | +### ✅ Advanced File Operations |
| 52 | +- [x] RestoreOptions with source, staged, and worktree control |
| 53 | +- [x] RemoveOptions with force, recursive, cached, and ignore-unmatch |
| 54 | +- [x] MoveOptions with force, verbose, and dry-run modes |
| 55 | +- [x] Type-safe builder patterns for all file operations |
| 56 | + |
| 57 | +### 🔄 Remote Branch Tracking (Future Enhancement) |
| 58 | +- [ ] `repo.branch_set_upstream(branch, remote_branch)` - Set tracking |
| 59 | +- [ ] `repo.branch_track(local, remote)` - Track remote branch |
| 60 | +- [ ] Remote branch listing and status |
| 61 | +- [ ] Pull operations (fetch + merge) |
| 62 | + |
| 63 | + |
| 64 | +## Phase 3: Release Management (Medium Priority) |
| 65 | + |
| 66 | +### Tag Operations |
| 67 | +- [ ] `repo.create_tag(name, message)` - Create annotated tag |
| 68 | +- [ ] `repo.create_lightweight_tag(name)` - Create lightweight tag |
| 69 | +- [ ] `repo.list_tags()` - List tags with filtering options |
| 70 | +- [ ] `repo.delete_tag(name)` - Delete tag |
| 71 | +- [ ] `repo.tag_info(name)` - Get tag details |
| 72 | +- [ ] `repo.push_tags()` - Push tags to remote |
| 73 | + |
| 74 | +### Archive & Export |
| 75 | +- [ ] `repo.archive(format, output_path)` - Create repository archive |
| 76 | +- [ ] `repo.export_commit(hash, path)` - Export specific commit |
| 77 | + |
| 78 | +## Phase 4: Development Workflow (Medium Priority) |
| 79 | + |
| 80 | +### Stash Management |
| 81 | +- [ ] `repo.stash_save(message)` - Save current changes |
| 82 | +- [ ] `repo.stash_push(files, message)` - Stash specific files |
| 83 | +- [ ] `repo.stash_list()` - List all stashes |
| 84 | +- [ ] `repo.stash_pop()` / `repo.stash_apply(index)` - Apply stashes |
| 85 | +- [ ] `repo.stash_drop(index)` / `repo.stash_clear()` - Remove stashes |
| 86 | +- [ ] `repo.stash_show(index)` - Show stash contents |
| 87 | + |
| 88 | +### Merge & Rebase |
| 89 | +- [ ] `repo.merge(branch)` / `repo.merge_commit(hash)` - Merge operations |
| 90 | +- [ ] `repo.rebase(onto_branch)` - Rebase current branch |
| 91 | +- [ ] `repo.cherry_pick(hash)` - Cherry-pick commit |
| 92 | +- [ ] Conflict resolution helpers and status |
| 93 | +- [ ] `repo.abort_merge()` / `repo.abort_rebase()` - Abort operations |
| 94 | + |
| 95 | +## Phase 5: Advanced Configuration (Medium Priority) |
| 96 | + |
| 97 | +### Enhanced Configuration |
| 98 | +- [ ] `Config::global()` - Global git configuration |
| 99 | +- [ ] `Config::system()` - System-wide configuration |
| 100 | +- [ ] Config scopes (system, global, local) |
| 101 | +- [ ] `repo.config().list_all()` - List all config with scopes |
| 102 | +- [ ] `repo.config().edit()` - Interactive config editing |
| 103 | + |
| 104 | +### Hook Management |
| 105 | +- [ ] `repo.hooks().install(hook_type, script)` - Install git hooks |
| 106 | +- [ ] `repo.hooks().list()` - List installed hooks |
| 107 | +- [ ] `repo.hooks().remove(hook_type)` - Remove hooks |
| 108 | +- [ ] Pre-built common hooks (pre-commit, pre-push, etc.) |
| 109 | + |
| 110 | +## Phase 6: Repository Analysis (Low Priority) |
| 111 | + |
| 112 | +### History & Inspection |
| 113 | +- [ ] `repo.show(hash)` - Show commit with full diff |
| 114 | +- [ ] `repo.blame(file, line_range)` - File annotation |
| 115 | +- [ ] `repo.diff(from, to)` - Diff between commits/branches |
| 116 | +- [ ] `repo.diff_files(from, to, paths)` - Diff specific files |
| 117 | + |
| 118 | +### Repository Health |
| 119 | +- [ ] `repo.statistics()` - Commit count, contributors, file stats |
| 120 | +- [ ] `repo.health_check()` - Repository integrity check |
| 121 | +- [ ] `repo.size_analysis()` - Large files, repository size analysis |
| 122 | +- [ ] `repo.gc()` / `repo.fsck()` - Maintenance operations |
| 123 | + |
| 124 | +## Phase 7: Advanced Features (Low Priority) |
| 125 | + |
| 126 | +### Worktree Support |
| 127 | +- [ ] `repo.worktree_add(path, branch)` - Add worktree |
| 128 | +- [ ] `repo.worktree_list()` - List worktrees |
| 129 | +- [ ] `repo.worktree_remove(path)` - Remove worktree |
| 130 | + |
| 131 | +### Batch Operations |
| 132 | +- [ ] `repo.batch()` - Transaction-like operations |
| 133 | +- [ ] Bulk file operations with progress callbacks |
| 134 | +- [ ] Atomic multi-step operations |
| 135 | + |
| 136 | +### Integration Helpers |
| 137 | +- [ ] Workspace detection (Cargo.toml, package.json, etc.) |
| 138 | +- [ ] CI/CD integration helpers |
| 139 | +- [ ] Git flow / GitHub flow shortcuts |
| 140 | +- [ ] Semantic versioning helpers |
| 141 | + |
| 142 | +## API Design Principles |
| 143 | + |
| 144 | +### Consistency |
| 145 | +- Repository-centric design: operations as methods on `Repository` |
| 146 | +- Consistent error handling with `Result<T, GitError>` |
| 147 | +- Type-safe enums for status, branch types, etc. |
| 148 | +- Builder patterns for complex operations with options |
| 149 | + |
| 150 | +### Performance |
| 151 | +- Lazy evaluation where possible |
| 152 | +- Streaming for large operations |
| 153 | +- Progress callbacks for long-running operations |
| 154 | +- Efficient caching of git command results |
| 155 | + |
| 156 | +### Ergonomics |
| 157 | +- Sensible defaults for common use cases |
| 158 | +- Method chaining where appropriate |
| 159 | +- Clear, descriptive method names |
| 160 | +- Comprehensive documentation with examples |
| 161 | + |
| 162 | +## Quality Standards |
| 163 | + |
| 164 | +### Testing |
| 165 | +- Unit tests for all public APIs |
| 166 | +- Integration tests with real git repositories |
| 167 | +- Cross-platform testing (Windows, macOS, Linux) |
| 168 | +- Performance benchmarks for critical operations |
| 169 | + |
| 170 | +### Documentation |
| 171 | +- Comprehensive rustdoc for all public APIs |
| 172 | +- Example code in documentation |
| 173 | +- Example programs in `examples/` directory |
| 174 | +- Clear error messages and recovery suggestions |
| 175 | + |
| 176 | +### Compatibility |
| 177 | +- Support latest stable Rust (currently 1.89+) |
| 178 | +- Cross-platform file path handling |
| 179 | +- Graceful handling of different git versions |
| 180 | +- Consistent behavior across operating systems |
| 181 | + |
| 182 | +## Implementation Notes |
| 183 | + |
| 184 | +### Technical Decisions |
| 185 | +- Continue using `std::process::Command` for git operations |
| 186 | +- Maintain clean separation between core types and command modules |
| 187 | +- Use `PathBuf` for all path operations for cross-platform compatibility |
| 188 | +- Implement `From` traits for ergonomic type conversions |
| 189 | + |
| 190 | +### Breaking Changes |
| 191 | +- Follow semantic versioning strictly |
| 192 | +- Deprecate before removing APIs |
| 193 | +- Provide migration guides for major version updates |
| 194 | +- Maintain backwards compatibility within major versions |
| 195 | + |
| 196 | +## Success Metrics |
| 197 | + |
| 198 | +### Adoption |
| 199 | +- Crates.io download counts |
| 200 | +- GitHub stars and forks |
| 201 | +- Community contributions and issues |
| 202 | +- Integration in other Rust projects |
| 203 | + |
| 204 | +### Quality |
| 205 | +- Test coverage > 90% |
| 206 | +- Documentation coverage 100% |
| 207 | +- Zero clippy warnings |
| 208 | +- Fast CI/CD pipeline (< 5 minutes) |
| 209 | + |
| 210 | +--- |
| 211 | + |
| 212 | +*This plan will be updated as features are implemented and priorities shift based on community feedback.* |
0 commit comments