Skip to content

add --absolute-git-hook-path to entire enable, this will setup your hooks with absolute paths to the entire binary#495

Merged
Soph merged 3 commits intomainfrom
soph/add-absolute-hook-path-option
Feb 27, 2026
Merged

add --absolute-git-hook-path to entire enable, this will setup your hooks with absolute paths to the entire binary#495
Soph merged 3 commits intomainfrom
soph/add-absolute-hook-path-option

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Feb 25, 2026

Addresses #489

This adds an optional setting to setup git hooks with absolute paths. I considered doing this always but I feel there is a risk path changes and then it just stops working when the most common use case is you have a full path available.

Entire-Checkpoint: 43cdf4753c06

…oks with absolute paths to the entire binary

Entire-Checkpoint: 43cdf4753c06
Copilot AI review requested due to automatic review settings February 25, 2026 16:18
@Soph Soph requested a review from a team as a code owner February 25, 2026 16:18
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 #489 by adding an entire enable flag to generate git hook scripts that invoke the entire binary via an absolute path (to support GUI git clients like Xcode that don’t inherit a full PATH).

Changes:

  • Add --absolute-git-hook-path flag and persist it as absolute_git_hook_path in .entire/settings*.json.
  • Update hook installation/warning code paths to support an absolute-path command prefix (with safe shell quoting).
  • Add unit tests for absolute-path hook installation and shellQuote.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/hooks.go Extend hook installation to support absolute binary paths; add shellQuote; load hook-related settings.
cmd/entire/cli/strategy/hooks_test.go Update hook installer calls for new signature; add tests for absolute-path hooks and shell quoting.
cmd/entire/cli/strategy/hook_managers.go Include absolute-path prefix in hook manager warnings.
cmd/entire/cli/strategy/hook_managers_test.go Update tests for new hook manager warning signature.
cmd/entire/cli/strategy/common.go Use persisted hook settings when ensuring hooks are installed.
cmd/entire/cli/setup.go Add EnableOptions struct and --absolute-git-hook-path flag; plumb through enable flows.
cmd/entire/cli/setup_test.go Update hook installer call signature.
cmd/entire/cli/settings/settings.go Add AbsoluteGitHookPath setting and merge behavior for absolute_git_hook_path.
cmd/entire/cli/bench_enable_test.go Update benchmark helper call to use EnableOptions.

@cursor
Copy link

cursor bot commented Feb 25, 2026

PR Summary

Medium Risk
Touches git hook generation and installation paths; incorrect path resolution or quoting could break hook execution for users enabling the new option.

Overview
Adds --absolute-git-hook-path to entire enable, plus a persisted absolute_git_hook_path setting, so generated git hooks can invoke the CLI via a shell-quoted absolute binary path (better compatibility with GUI git clients that don’t have entire on PATH).

Refactors enable/setup code to pass a single EnableOptions struct and threads the new option through strategy.InstallGitHook/CheckAndWarnHookManagers and EnsureSetup; hook prefix resolution now supports absolute-path mode and includes new tests for absolute-path hook content and shellQuote.

Written by Cursor Bugbot for commit 4a08b56. Configure here.

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

@toothbrush toothbrush changed the title add --abolute-git-hook-path to entire enable, this will setup your hooks with absolute paths to the entire binary add --absolute-git-hook-path to entire enable, this will setup your hooks with absolute paths to the entire binary Feb 25, 2026
Copy link
Contributor

@toothbrush toothbrush left a comment

Choose a reason for hiding this comment

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

I think this looks good! Only concern i have is the flag's name. The setting influences both Git hooks as well as agent hooks, so should we call it --absolute-hook-paths?

…k-path-option

# Conflicts:
#	cmd/entire/cli/bench_enable_test.go
#	cmd/entire/cli/setup.go
#	cmd/entire/cli/setup_test.go
#	cmd/entire/cli/strategy/common.go
#	cmd/entire/cli/strategy/hook_managers.go
#	cmd/entire/cli/strategy/hook_managers_test.go
#	cmd/entire/cli/strategy/hooks.go
#	cmd/entire/cli/strategy/hooks_test.go

Entire-Checkpoint: 1c7d96957309
@Soph
Copy link
Collaborator Author

Soph commented Feb 26, 2026

@toothbrush no this is really only changing the git hooks. I felt for the agent hooks this doesn't make sense since relative paths are always better I think and the agent is started from an interactive shell so paths should be i.O. for these hooks.

@toothbrush
Copy link
Contributor

@toothbrush no this is really only changing the git hooks.

Ah yes, i looked again, carefully 👍

I felt for the agent hooks this doesn't make sense since relative paths are always better I think and the agent is started from an interactive shell so paths should be i.O. for these hooks.

That surprises me, is that also true for e.g. Cursor IDE? Typically (in macOS at least) GUI apps have pretty bare-bones environments.

@Soph
Copy link
Collaborator Author

Soph commented Feb 27, 2026

@toothbrush yes, cursor IDE works, and if we run into an issue with another IDE I would change it only there.

Copy link
Member

@squishykid squishykid left a comment

Choose a reason for hiding this comment

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

💯

@Soph Soph merged commit 6e8cfd5 into main Feb 27, 2026
3 checks passed
@Soph Soph deleted the soph/add-absolute-hook-path-option branch February 27, 2026 20:51
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.

5 participants