# Release v0.2.1

## 🐛 Bug Fixes

### Windows Alias Installation Fix (Issue #7)

**Problem**: `gcop-rs alias` command failed on Windows platform because it used Unix-specific `which` command.

**Solution**: Use cross-platform `which` crate instead, automatically handling Windows `.exe` extension and different platform PATH separators.

Windows users can now use `gcop-rs alias` and `gcop-rs init` to install aliases normally.

## ♻️ Code Refactoring

### Commit Command State Machine Refactor

Refactored commit command to state machine pattern (new `commit_state_machine.rs` module), improving testability and maintainability.

- ✅ Clearer state transition logic
- ✅ Better test coverage
- ✅ User experience unchanged

## ✅ Test Enhancements

Added **500+ lines** of test code:

- Config loading and validation tests
- Commit state machine tests
- Error suggestion tests
- Git diff statistics tests
- LLM prompt and provider tests

Testing tools: Added `mockall = "0.13"` (optional) for mock testing.

## 📚 Cross-Platform Documentation

All documentation updated to support **Linux/macOS/Windows** platforms:

**Configuration Paths**:
- Linux: `~/.config/gcop/config.toml`
- macOS: `~/Library/Application Support/gcop/config.toml`
- Windows: `%APPDATA%\gcop\config.toml`

**Installation Guide**:
- Simplified README to recommend `cargo install gcop-rs`
- Added Windows PowerShell install/update/uninstall commands
- All configuration instructions distinguish by platform

**Updated Documentation**:
- `README.md` / `README_ZH.md`
- `docs/installation.md` / `docs/zh/installation.md`
- `docs/configuration.md` / `docs/zh/configuration.md`
- `docs/commands.md` / `docs/zh/commands.md`

## 📦 Dependency Changes

- Added `which = "8.0.0"` - Cross-platform executable lookup
- Added `mockall = "0.13"` (optional) - Test mock tool

## Upgrade Notes

Upgrading from v0.2.0 requires **no action**, fully backward compatible.

## 📦 Installation

```bash
cargo install gcop-rs
```

## Statistics

```
25 files changed
+2267 insertions
-157 deletions
```

## 📚 Documentation

- [Installation Guide](../installation.md)
- [Configuration Guide](../configuration.md)
- [Full Changelog](../../CHANGELOG.md)

## Feedback

If you have any issues or suggestions, please submit an [Issue](https://github.com/AptS-1547/gcop-rs/issues).
