Skip to content

fix(settings): activate hooks for entire enable --local#1149

Open
ivasuy wants to merge 1 commit into
entireio:mainfrom
ivasuy:fix/issetupandenabled-local-only-1123
Open

fix(settings): activate hooks for entire enable --local#1149
ivasuy wants to merge 1 commit into
entireio:mainfrom
ivasuy:fix/issetupandenabled-local-only-1123

Conversation

@ivasuy
Copy link
Copy Markdown

@ivasuy ivasuy commented May 8, 2026

Summary

Fixes #1123.

This PR switches IsSetUpAndEnabled to IsSetUpAny, which already exists and correctly checks for either file. Load() already merges both files and defaults Enabled: true when only the local file is present, so the loaded value was always correct. The only broken piece was the presence check.

Changes

  • cmd/entire/cli/settings/settings.go

    • One-line fix: IsSetUpAndEnabled now calls IsSetUpAny(ctx) instead of IsSetUp(ctx).
    • Updated the doc comment to explain the local-only setup case.
  • cmd/entire/cli/settings/settings_test.go

    • Added regression coverage:
      • TestIsSetUpAndEnabled_LocalOnly
      • TestIsSetUpAndEnabled_LocalOnlyDisabled
      • TestIsSetUpAndEnabled_NoFiles
      • TestIsSetUpAndEnabled_BaseOnlyEnabled
    • Added a new setupSettingsRepo helper using testutil.InitRepo so paths.WorktreeRoot() resolves correctly through AbsPath.
    • Kept the existing setupSettingsDir for fake .git directory cases, but avoided using it for tests that need real path resolution.

Verification

mise run check

Result:

fmt + lint + test:ci — all green
go test ./cmd/entire/cli/settings/ -run TestIsSetUpAndEnabled -v

Result:

passed

I also confirmed the new TestIsSetUpAndEnabled_LocalOnly regression test fails on main without the one-line fix and passes with it. That confirms the test locks in the actual fix instead of asserting tautologically.

End-to-end smoke test:

  • Created a scratch repo.
  • Ran:
entire enable --local
  • Made a commit.
  • Confirmed a checkpoint was saved on entire/checkpoints/v1.

Before the fix, the same flow produced no shadow branch and no checkpoint.

@ivasuy ivasuy requested a review from a team as a code owner May 8, 2026 04:30
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Git hooks silently no-op when only .entire/settings.local.json exists (entire enable --local)

1 participant