Use absolute binary path in git hooks for robustness#49
Closed
toothbrush wants to merge 6 commits intomainfrom
Closed
Use absolute binary path in git hooks for robustness#49toothbrush wants to merge 6 commits intomainfrom
toothbrush wants to merge 6 commits intomainfrom
Conversation
Instead of assuming 'entire' is in PATH when git hooks execute, use os.Executable() to get the absolute path of the currently-running binary. This ensures hooks work correctly regardless of the user's PATH configuration at hook execution time. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
I'm very open to input on this one – getting these sort of CLI tool ergonomics right is hard, because they need to work in all kinds of scenarios for people with all sorts of weird environments. I think this represents a reasonable improvement, but keen to hear what folks think. |
Collaborator
|
Just realized something: the issue with the absolut path is that if you would commit that |
Contributor
Author
|
Ahh true, good point! 🤦 On 17 Jan 2026, at 00:42, Stefan Haubold ***@***.***> wrote:Soph left a comment (entireio/cli#49)
Just realized something: the issue with the absolut path is that if you would commit that .claude/settings.json then, it would make the hooks not work on another machine since most likely the absolut path wouldn't be the same 🤔
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
qiangmao
pushed a commit
to qiangmao/cli
that referenced
this pull request
Feb 12, 2026
Like entirehq/entiredb#260. I think this is a better solution to the problem discussed in entireio/cli#49.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Instead of assuming 'entire' is in PATH when git hooks execute, use os.Executable() to get the absolute path of the currently-running binary. This ensures hooks work correctly regardless of the user's PATH configuration at hook execution time.
The issue i was addressing here was that i like to run with
go build ./cmd/entire && ./entirewhile doing local dev, rather thango run .... As a result Entire thinks it's running as "installed-globally mode", causing Git hooks to be incorrectly configured, and fail.E.g.,
If someone does globally install Entire, the absolute path should resolve to their
$GOROOTor the Homebrew location or whatever. As another side-effect, if Git is used from within a GUI app that doesn't set a reasonable value for$PATH, the proposed approach will work better.