Skip to content

fix: clean message when running crit on a repo with no changes#439

Merged
tomasz-tomczyk merged 1 commit intomainfrom
fix/438-clean-repo-misleading-daemon-error
May 2, 2026
Merged

fix: clean message when running crit on a repo with no changes#439
tomasz-tomczyk merged 1 commit intomainfrom
fix/438-clean-repo-misleading-daemon-error

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Pre-flight git-mode change detection in the parent before spawning the daemon. If the working tree has no changes against the base ref (after ignore patterns), print a friendly hint and exit 1 — instead of spawning a daemon that signals readiness, fails init, and leaves the client polling a dead port with the misleading "could not reach daemon / connection refused" error.
  • New error: No changed files found. followed by two recovery hints (crit for default mode, crit <file...> for explicit files). Internal subcommands kept out of the user-facing copy.
  • Promoted the inline "no changed files" string to an exported sentinel ErrNoChangedFiles so the preflight can errors.Is it.

Closes #438

Review

  • Code review: passed (intent audit clean, go-expert review skipped per user)
  • Parity audit: N/A — CLI-only daemon flow, no review-page surface touched

Test plan

  • go test -race ./... — full suite green
  • golangci-lint run ./... — clean
  • Manual e2e: clean git repo with no changes → friendly message + exit 1, no daemon spawn
  • Manual e2e: repo with changes → daemon spawns normally

🤖 Generated with Claude Code

Pre-flight git-mode change detection in the parent before spawning the
daemon. If the working tree has no changes against the base ref (after
ignore patterns), print a friendly two-line hint and exit 1 instead of
spawning a daemon that signals readiness, fails init, and leaves the
client polling a dead port.

Closes #438
@tomasz-tomczyk tomasz-tomczyk merged commit 36df0c4 into main May 2, 2026
6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix/438-clean-repo-misleading-daemon-error branch May 2, 2026 21:22
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.39%. Comparing base (95b8ab7) to head (b83ad08).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cli_serve.go 73.33% 2 Missing and 2 partials ⚠️
main.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
- Coverage   67.42%   67.39%   -0.03%     
==========================================
  Files          35       35              
  Lines        9820     9839      +19     
==========================================
+ Hits         6621     6631      +10     
- Misses       2685     2692       +7     
- Partials      514      516       +2     
Flag Coverage Δ
e2e 34.03% <0.00%> (-0.08%) ⬇️
unit 63.66% <60.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crit on a clean working tree: misleading "could not reach daemon" instead of "no changed files"

1 participant