fix: use absolute path in git hooks for GUI app compatibility#664
Open
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Open
fix: use absolute path in git hooks for GUI app compatibility#664mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Conversation
Always resolve the absolute binary path via os.Executable() when generating git hook scripts, instead of using bare "entire". GUI git clients (Xcode, Tower, etc.) don't source shell profiles, so ~/.local/bin is not on PATH and hooks fail with "entire: command not found". Falls back gracefully to bare "entire" if path resolution fails. Fixes entireio#489 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #489
The
--absolute-git-hook-pathflag (shipped in v0.4.9) solved this for users who knew about it, but the default behavior still uses bareentirewhich breaks in GUI git clients. This PR makes absolute path resolution the default, so hooks work out of the box in Xcode, Tower, and other GUI git clients that don't source shell profiles.Changes
hookCmdPrefix()to always resolve the absolute binary path viaos.Executable()when not in localDev modeentireif path resolution fails (e.g., in test environments)absolutePathparameter is now ignored (kept for API compatibility) since absolute paths are always usedTesting
entire enableand verify generated hooks in.git/hooks/contain absolute pathsmise run testto verify updated unit tests passThis contribution was developed with AI assistance (Claude Code).