Skip to content

Comments

Make git hooks a noop if entire is not enabled in the repo#467

Open
Soph wants to merge 1 commit intomainfrom
soph/entire-log-folder-bug
Open

Make git hooks a noop if entire is not enabled in the repo#467
Soph wants to merge 1 commit intomainfrom
soph/entire-log-folder-bug

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Feb 23, 2026

In the case of git hooks being installed but entire not enabled in the repository this will make any git hook call a noop.

#460

@Soph Soph requested a review from a team as a code owner February 23, 2026 15:55
Copilot AI review requested due to automatic review settings February 23, 2026 15:55
@cursor
Copy link

cursor bot commented Feb 23, 2026

PR Summary

Low Risk
Behavior is narrowly scoped to hook execution gating and adds test coverage; primary risk is unintentionally skipping hooks if settings detection fails (e.g., path resolution/load errors).

Overview
Git hook commands are now no-ops when Entire is not configured for the current repo or has been disabled, preventing globally-installed hooks from creating .entire artifacts or running strategy handlers.

This adds settings.IsSetUp() / settings.IsSetUpAndEnabled() and uses them in hooks_git_cmd.go to skip initHookLogging() (defense-in-depth) and to gate each hook subcommand via a gitHooksDisabled flag. Tests were updated to create settings.json where required and new cases assert logging does not create .entire/logs when not set up or when enabled:false.

Written by Cursor Bugbot for commit e0dc047. Configure here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #460 by making git hooks no-ops when Entire is not enabled in a repository. The fix prevents global git hooks from creating .entire/logs/ directories in repos where Entire has never been set up or has been disabled.

Changes:

  • Added IsSetUp() and IsSetUpAndEnabled() helper functions to check if Entire is active in a repo
  • Updated git hook commands to check if Entire is enabled before performing any operations
  • Added comprehensive tests for the new behavior (skipping when not set up or disabled)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/settings/settings.go Adds IsSetUp() and IsSetUpAndEnabled() helper functions to check repository setup status
cmd/entire/cli/hooks_git_cmd.go Adds checks to exit early from git hooks when Entire is not set up or disabled, preventing file creation
cmd/entire/cli/hooks_git_cmd_test.go Adds tests for the new skip behavior and updates existing tests to create settings.json
cmd/entire/cli/hook_registry_test.go Updates test to create settings.json for proper test setup

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

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.

1 participant