Repository navigation
Release 0.6.4: install-agent keeps a narrowed hook matcher - #201
Merged
Merged
Conversation
A re-run replaced the whole entry, so a matcher a repository had narrowed (e.g. PreToolUse to "Grep|Glob|Agent", keeping the hook off Bash) was reset to the default on every upgrade. The entry is still replaced, but its existing matcher is carried over; only a fresh entry gets the default.
…w default Keeping every matcher on our entry also froze the ones we wrote, so a default widened for a changed hook would never reach an existing install. A matcher found in PAST_MATCHERS, or equal to the default, is ours and takes the current default; any other is kept and named in a note beside the default it hides.
…st list The hook script's second line names the release and the matchers it installed. A re-run reads it before rewriting: a matcher it wrote moves to the current default, any other is kept. Drops PAST_MATCHERS and the note.
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
A re-run of
install-agent --claudereplaced zerograph's hook entries whole, so amatchera repository had narrowed on purpose (PreToolUse withoutBash) went back to the default on every upgrade. The entry is still updated; its existing matcher is carried over, and only a new entry gets the default. The hook script's second line now records the release and the matchers it installed (// zerograph 0.6.4 wrote: PreToolUse=…); a re-run moves a matcher it wrote to the current default, so a future default change still reaches untouched installs, and keeps any other.Test plan
a_matcher_set_on_our_entry_survives_a_re_runfails before the fix, passes aftera_matcher_the_stamp_records_moves_to_the_new_defaultcovers the upgrade pathcargo testgreen,cargo clippy --all-targets -- -D warningscleanzerograph --versionprints 0.6.4