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
- Fresh repo with no prior Entire setup.
- Run
entire enable --local.
- Make changes and commit — hooks fire but do nothing (no checkpoints saved).
- 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.
Description
Running
entire enable --localinstalls git hooks but creates only.entire/settings.local.json. The hooks then silently do nothing because their activation check requires.entire/settings.jsonto exist.Steps to reproduce
entire enable --local.entire enable(which creates.entire/settings.json) — hooks now work.Root cause
The hooks'
PersistentPreRunEcallssettings.IsSetUpAndEnabled(), which internally callsIsSetUp(). That function checks only for.entire/settings.json:IsSetUpAny()already exists and correctly checks either file, butIsSetUpAndEnableddoesn't use it.Fix
Change
IsSetUpAndEnabledto useIsSetUpAnyinstead ofIsSetUp.Load()already merges both files and defaultsEnabled: truewhensettings.jsonis absent, so the loaded value is correct — the only broken piece is the presence check.Workaround
Run
entire enable(without--local) afterentire enable --localto create.entire/settings.json.