# Milestone v1.2: More Commands Support

**Status:** SHIPPED 2026-01-20
**Phases:** 15-19
**Total Plans:** 10

## Overview

Extended command support with 13 additional git commands translated to Sapling equivalents. This milestone expanded GitSL from core commands to cover common workflows including file operations, stash management, branching, and the complex checkout command with proper disambiguation.

## Phases

### Phase 15: Direct Pass-through Commands

**Goal**: Users can view commits, blame files, and perform file operations with simple git commands
**Depends on**: None (builds on existing cmd_*.py pattern)
**Plans**: 2 plans

Plans:
- [x] 15-01-PLAN.md - Create 6 command handlers and dispatch routing
- [x] 15-02-PLAN.md - E2E tests for all 6 commands

**Requirements**:
- SHOW-01, SHOW-02 (git show)
- BLAME-01, BLAME-02 (git blame)
- RM-01, RM-02, RM-03 (git rm)
- MV-01, MV-02 (git mv)
- CLONE-01, CLONE-02 (git clone)
- GREP-01, GREP-02 (git grep)

**Success Criteria**:
1. User can run `git show` to view the most recent commit
2. User can run `git blame <file>` to see per-line annotations
3. User can run `git rm <file>` to remove tracked files
4. User can run `git mv <src> <dst>` to rename/move files
5. User can run `git clone <url>` to clone a repository

---

### Phase 16: Flag Translation Commands

**Goal**: Users can run config, clean, and switch commands with proper flag translation to Sapling equivalents
**Depends on**: Phase 15 (establishes handler pattern rhythm)
**Plans**: 2 plans

Plans:
- [x] 16-01-PLAN.md - Create 3 command handlers (clean, config, switch) with flag translation
- [x] 16-02-PLAN.md - E2E tests for all 8 requirements

**Requirements**:
- CLEAN-01, CLEAN-02, CLEAN-03 (git clean)
- CONFIG-01, CONFIG-02, CONFIG-03 (git config)
- SWITCH-01, SWITCH-02 (git switch)

**Success Criteria**:
1. User can run `git clean -f` to remove untracked files
2. User can run `git clean -n` to preview files that would be removed (dry run)
3. User can run `git config <key>` to read configuration values
4. User can run `git config <key> <value>` to set configuration values
5. User can run `git switch <branch>` to change branches

---

### Phase 17: Branch and Restore

**Goal**: Users can manage branches (bookmarks) and restore files to previous states
**Depends on**: Phase 16 (switch establishes goto pattern)
**Plans**: 2 plans

Plans:
- [x] 17-01-PLAN.md - Create branch and restore command handlers with dispatch routing
- [x] 17-02-PLAN.md - E2E tests for all 6 requirements

**Requirements**:
- BRANCH-01, BRANCH-02, BRANCH-03, BRANCH-04 (git branch)
- RESTORE-01, RESTORE-02 (git restore)

**Success Criteria**:
1. User can run `git branch` to list all bookmarks
2. User can run `git branch <name>` to create a new bookmark
3. User can run `git branch -d <name>` to delete a bookmark
4. User can run `git restore <file>` to discard uncommitted changes to a file
5. User can run `git restore .` to discard all uncommitted changes

---

### Phase 18: Stash Operations

**Goal**: Users can save, restore, list, and manage temporary changes using git stash workflow
**Depends on**: Phase 17 (restore pattern informs stash apply)
**Plans**: 2 plans

Plans:
- [x] 18-01-PLAN.md - Create stash command handler with subcommand dispatch
- [x] 18-02-PLAN.md - E2E tests for all 7 stash requirements

**Requirements**:
- STASH-01, STASH-02, STASH-03 (stash save)
- STASH-04 (stash pop)
- STASH-05 (stash apply)
- STASH-06 (stash list)
- STASH-07 (stash drop)

**Success Criteria**:
1. User can run `git stash` to save uncommitted changes
2. User can run `git stash pop` to apply and remove the most recent stash
3. User can run `git stash apply` to apply stash without removing it
4. User can run `git stash list` to see all saved stashes
5. User can run `git stash drop` to delete the most recent stash

---

### Phase 19: Checkout Command

**Goal**: Users can use the overloaded git checkout command with correct disambiguation between switching branches, restoring files, and creating branches
**Depends on**: Phase 17 (branch pattern), Phase 16 (switch pattern), Phase 17 (restore pattern)
**Plans**: 2 plans

Plans:
- [x] 19-01-PLAN.md - Create checkout command handler with disambiguation logic
- [x] 19-02-PLAN.md - E2E tests for all 6 checkout requirements

**Requirements**:
- CHECKOUT-01 (checkout commit)
- CHECKOUT-02 (checkout branch)
- CHECKOUT-03, CHECKOUT-04 (checkout file)
- CHECKOUT-05 (checkout -b)
- CHECKOUT-06 (disambiguation logic)

**Success Criteria**:
1. User can run `git checkout <branch>` to switch to an existing branch
2. User can run `git checkout -b <name>` to create and switch to a new branch
3. User can run `git checkout -- <file>` to restore a file to its committed state
4. User can run `git checkout <commit>` to check out a specific commit
5. Ambiguous arguments (file with same name as branch) are correctly disambiguated

---

## Milestone Summary

**Key Decisions:**
- Safety validation for clean (enforce -f/-n before sl purge)
- Translate -D to -d for branch delete (prevent sl bookmark -D from stripping commits)
- Subcommand dispatch for stash (handle push/pop/apply/list/drop patterns)
- Checkout disambiguation via sl log -r (use exit code to validate revision)
- Error on ambiguity (file=revision) (explicit error better than silent priority)

**Issues Resolved:**
- Checkout disambiguation for overloaded git checkout command
- Safety validation for destructive clean operations
- Stash conflict handling on pop
- Bookmark model mismatch between git branch and sl bookmark

**Issues Deferred:**
- stash@{n} syntax for referencing older stashes (Sapling uses named shelves)
- git stash -p for partial stashing (interactive, requires terminal control)
- Output format transformation for blame/branch/stash (pass-through sufficient)

**Technical Debt Incurred:**
None significant.

---

_For current project status, see .planning/ROADMAP.md_
