Skip to content

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

@jstewmon

Description

@jstewmon

Description

Running entire enable --local installs git hooks but creates only .entire/settings.local.json. The hooks then silently do nothing because their activation check requires .entire/settings.json to exist.

Steps to reproduce

  1. Fresh repo with no prior Entire setup.
  2. Run entire enable --local.
  3. Make changes and commit — hooks fire but do nothing (no checkpoints saved).
  4. Run entire enable (which creates .entire/settings.json) — hooks now work.

Root cause

The hooks' PersistentPreRunE calls settings.IsSetUpAndEnabled(), which internally calls IsSetUp(). That function checks only for .entire/settings.json:

// settings.go
func IsSetUp(ctx context.Context) bool {
    _, err = os.Stat(settingsFileAbs)  // only checks settings.json
    return err == nil
}

func IsSetUpAndEnabled(ctx context.Context) bool {
    if !IsSetUp(ctx) {  // returns false when only settings.local.json exists
        return false
    }
    ...
}

IsSetUpAny() already exists and correctly checks either file, but IsSetUpAndEnabled doesn't use it.

Fix

Change IsSetUpAndEnabled to use IsSetUpAny instead of IsSetUp. Load() already merges both files and defaults Enabled: true when settings.json is absent, so the loaded value is correct — the only broken piece is the presence check.

Workaround

Run entire enable (without --local) after entire enable --local to create .entire/settings.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions