Canonicalize linked worktree hook trust keys#24966
Draft
abhinav-oai wants to merge 1 commit into
Draft
Conversation
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.
Why
Fixes #23996.
Project hooks in linked Git worktrees were being discovered from the root checkout's
.codexfolder. That preserved a single trust state, but it also meant the active worktree could stop being the source of truth for hook declarations.That was especially confusing because hooks still execute with the active worktree as their
cwd. Hook authors reasonably write commands that resolve paths from the worktree, such as scripts under$(git rev-parse --show-toplevel)/.codex/...; loading the declaration from the root checkout while executing in the linked worktree made those paths disagree.The goal here is to keep the useful trust property without making hook authors target a separate config directory or giving every worktree its own growing trust entry.
What
.codexfolder.source_pathpointed at the active worktree, while using the canonical path only for key generation.