anvil commit view <sha> — inspect a single commit #17
Links
No links yet.
Problem
`anvil commit` only has `list`. No way to view a single commit’s metadata + diff via the CLI.
Proposal
`anvil commit view ` — show author, date, message, file stat, optionally full diff with `–diff`.
Implementation
Could be served via local `git show ` if the repo is cloned, OR via a new server endpoint `GET /api/v1/:org/:repo/commits/:sha`.
Acceptance criteria
- `anvil commit view ` shows commit metadata
- `–diff` includes the patch
- `–json` for scripting
- Works in cloned repo OR via server (decide implementation)
Origin
CLI gap audit. Lower priority.
Implemented — shipped in commit 0430ea2 (“feat(cli): –json flag, pr diff/checkout, commit view, milestone create”).
Verified on main: anvil commit view <sha> exists with --diff to include the patch and honours the global --json (the git output is captured into the payload rather than streamed, per #32). Acceptance criteria all met.