Comprehensive, checkable list for implementing GitCherry (Go, CLI/TUI)
- Initialize repo & module
-
go mod init github.com/<you>/gitcherry - Add deps:
tview,cobra,testify(and optionallygolangci-lint) - Create
Makefile(build/test/lint/run) - Add CI workflow (
.github/workflows/ci.yml): build +go test ./... - Add
LICENSE(MIT) - Add
.gitignore(Go, editor,.gitcherry/logs) - Seed
README.mdwith brief intro + link todocs/design_spec.md
-
- Docs folder
- Project layout
-
/cmd/gitcherry -
/internal/git -
/internal/tui -
/internal/ops -
/internal/config -
/internal/logs -
/tests(fixtures/helpers)
-
- Implement
internal/config-
Configstruct with defaults (on_duplicate, preview, autorefresh, default_branch, message_template) - Loader: repo
.gitcherry.yml->$HOME/.config/gitcherry/config.yml-> defaults (+ env vars) - Unit tests: missing file, partial override, full override
-
- Implement
internal/git-
RunnerwithRun(args ...string)(envGIT_TERMINAL_PROMPT=0) - Helpers:
CurrentBranch,IsClean,Fetch,ListBranches,CommitsBetween,PatchID -
Commitstruct (Hash, Author, Date, Message, Files) - Temp-repo fixtures under
/testsand unit tests for helpers
-
- Cobra root command in
/cmd/gitcherry- Global flags:
--apply,--refresh,--no-preview - Subcommands:
transfer,revert,restore,undo,redo - Pre-run: require clean workspace via
git.IsClean() - Tests: help output, unknown flag handling, dirty workspace exit
- Global flags:
- App shell
-
Appstruct with refs to git runner + config - Views: BranchList, CommitList, PreviewModal, HelpModal
- Keybindings:
?help,qquit - Tests: init + help toggle
-
- Branch selection view
- List local branches (focus highlight)
- First select = source; second = target -> open CommitList
- Banner: "Press
rto refresh remotes" (wired to fetch) - Tests: selection flow state
- Commit selection (contiguous only)
- Show commits from
CommitsBetween(target, source) - Start mark with Space, end confirm with Enter
- Selected range highlighted
- Tests: start/end capture
- Show commits from
- Preview + message UX
- Table summary (hash short, author, subject)
- Display target branch and "-> Will become 1 new commit"
- Actions: Edit message, Use suggested message
- Tests: template rendering, action selection
- Planner (dry-run)
- Generate steps: checkout target -> cherry-pick
--no-commitrange -> commit - CLI dry-run prints steps; TUI shows preview
- Tests: sequence generation
- Generate steps: checkout target -> cherry-pick
- Executor (apply) with conflicts
- Run planned steps
- Detect conflicts; expose
ErrConflict - TUI modal: "Resolve manually or Abort" flow
- CLI conflict guidance & non-zero exit
- Integration tests: resolve path + abort path
- Audit log + undo/redo enqueue
-
.gitcherry/logs/<timestamp>.jsonwriter -
.gitcherry/undo.jsonqueue (push on success) - Tests: serialization + queue behavior
-
-
revertoperation- Planner:
git revert --no-commit <start>^..<end>->git commit -m ... - Conflict handling: continue/abort
- Reuse preview + messaging
- Integration tests (basic success path)
- Planner:
-
restoreoperation- Commit picker -> prompt branch name ->
git branch <name> <commit> - Audit log + undo entry (delete via manual undo guidance)
- Tests: unit + integration
- Commit picker -> prompt branch name ->
- Duplicate detection
- Compute
patch-idfor selected commits; compare on target - TUI: ask on duplicates (Yes/No)
- CLI:
--on-duplicate=ask|skip|applydefaulting to skip when non-interactive - Tests with crafted commits
- Compute
- Refresh controls
-
--refreshflag triggersgit fetch --prune --tags - TUI key
rperforms fetch and reloads lists - Tests: mocked fetch
-
- Wire all cobra handlers fully
-
transfer --from --to --range a..b [--message|--edit|--auto-message] [--apply] -
revert --on HEAD --range a..b -
restore --at <commit> --branch-name <name> -
undo,redo - Tests: arg parsing, planner wiring
-
- Help panel & colors
-
?shows keybindings - ANSI-safe color constants with monochrome fallback
- Tests: color guard logic
-
- Usage docs
- Create
docs/USAGE.md(Quickstart, TUI flow, CLI examples, conflict handling)
- Create
s
- Create
docs/USAGE.md(Quickstart, TUI flow, CLI examples, conflict handling)
- TUI golden snapshot tests (
/tests/golden)- Deterministic dataset
-
make regen-goldentarget
- Cross-platform builds
-
Makefiletargets for darwin/linux/windows amd64/arm64 - (Optional)
goreleaserconfig
-
- README updates
- Install instructions (binaries or
go install) - Link to
docs/USAGE.md
- Install instructions (binaries or
- Non-contiguous selection (advanced) with dependency warnings
- GitLab API integration
- Multi-repo mode (workspace orchestrator)
- Persist last-viewed branch/session
- External difftool handoff (
D)
- Keep PRs small (per milestone/step)
- Ensure CI stays green before moving to next milestone