Skip to content

init exits 1 on a healthy local repository, because a skipped check counts as needing attention #107

Description

@MongLong0214

Reproduced myself in a fresh git init repository with no remote — the state every project starts in.

$ commitlore init
[1/4] hooks install            ok
[2/4] index --rebuild          ok
[3/4] claude hook install      ok
[4/4] doctor --fix
        ok      cli runtime
        ok      notes push
        ok      commit-msg hook
        ok      hook runtime
        ok      PreToolUse hook runtime
        ok      git interpret-trailers
        ok      history depth
        ok      index health
        skipped squash conservation — nothing to check

init: 4/4 steps ran, 1 need(s) attention — doctor --fix
                                                            exit 1

Every check is ok. The only non-ok line is a skipped, which by its own wording means there was nothing to check. init counts it as needing attention and exits 1.

Why this matters more than an off-by-one

init is the onboarding command — the first thing a new user runs, and the command the README's first screen leads to. It reports failure on a perfectly healthy setup, in the most common starting state there is.

It also trains the wrong reflex. A user who sees exit 1 on their first successful run learns that init's exit code means nothing, and stops reading it — which is precisely when it will matter.

Under #65's convention, exit 1 means "ran, found what the caller asked about". A skipped check found nothing. This should be 0.

Also reported independently

An agent working in another project hit the same thing and reported it as friction: " exited code 1 despite 4/4 steps completing, solely because found a non-fatal warn-level issue unrelated to this repo's work — a warning escalated to a failing exit code." Two independent sightings within the hour.

What a fix must get right

  • skipped is not warn. Do not collapse the two.
  • A genuine warn that init cannot resolve itself should still exit non-zero — that behaviour is correct and was deliberate. Only skipped is miscounted.
  • Verify against both: a fresh no-remote repo must exit 0, and a repo with a real unresolvable warning must still exit 1. A fix that makes init always exit 0 is worse than the bug.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions