ripple diff uses git under the hood, so a broken/nonexistent ref or a dirty tree fails the run. Detect these cases in advance and report them as friendly RippleError messages instead of a raw git stack trace.
Acceptance criteria
- A missing
--base ref reports something like: base ref 'feature/x' not found (fetched heads: main, develop).
- A repo with no commits yet (fresh
git init, no HEAD) reports a clear "not a git repo / no commits yet" message instead of crashing.
- Non-zero
git exits keep their stderr in the error message so the underlying cause is still visible.
- Unit tests cover: missing ref, empty repo, dirty-tree diff against
HEAD~1 (should still work).
Where to look
src/commands/diff.ts (git invocations live there), src/utils/errors.ts for the error constructor style, src/utils/fs.ts for safe filesystem helpers.
Out of scope
- Auto-fetching refs or changing the git strategy.
ripple diffusesgitunder the hood, so a broken/nonexistent ref or a dirty tree fails the run. Detect these cases in advance and report them as friendlyRippleErrormessages instead of a rawgitstack trace.Acceptance criteria
--baseref reports something like:base ref 'feature/x' not found (fetched heads: main, develop).git init, no HEAD) reports a clear "not a git repo / no commits yet" message instead of crashing.gitexits keep their stderr in the error message so the underlying cause is still visible.HEAD~1(should still work).Where to look
src/commands/diff.ts(git invocations live there),src/utils/errors.tsfor the error constructor style,src/utils/fs.tsfor safe filesystem helpers.Out of scope