Fix hook binary resolution for managed installs#760
Open
mariusvniekerk wants to merge 2 commits into
Open
Conversation
roborev init previously baked the running executable into git hooks, which is brittle when the command was launched through a version manager. mise and Homebrew both expose stable shim or bin paths while keeping the actual executable under versioned install directories, so hooks could be pinned to a binary that later disappeared after an update. This adds an explicit hook binary override and makes the default resolver prefer empirically verified stable paths for mise and Homebrew installs. It intentionally avoids guessing rtx/asdf layouts because container probes and current docs did not show a standard roborev install path there; users can still pass --binary for custom setups. Validation: go fmt ./...; go test ./internal/githook; go vet ./...; go test ./...; make lint; Docker probes for mise Go backend, mise GitHub backend, Homebrew/Linuxbrew, rtx, and asdf. 🤖 Generated with [OpenAI Codex](https://openai.com/codex) Co-authored-by: OpenAI Codex <noreply@openai.com>
roborev: Combined Review (
|
The managed-install resolver only helps if existing current-version hooks can move off an old baked binary path. Without this, rerunning roborev init or install-hook with a stable shim leaves v4/v2 hooks untouched because the version marker already matches. This treats a current hook as reusable only when its generated ROBOREV assignment matches the resolved or explicit binary path. Otherwise the roborev block is removed and re-rendered, preserving surrounding user hook content for embedded installs. Validation: go test ./internal/githook; go vet ./...; go test ./...; make lint 🤖 Generated with [OpenAI Codex](https://openai.com/codex) Co-authored-by: OpenAI Codex <noreply@openai.com>
roborev: Combined Review (
|
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
--binarytoroborev initandinstall-hookso users can explicitly choose the roborev executable baked into git hooksValidation
go fmt ./...go test ./internal/githookgo vet ./...go test ./...make lint