From 1063a457f94bcff68cd335b34485837baa4aa1fd Mon Sep 17 00:00:00 2001 From: Jonny Spicer Date: Tue, 11 Aug 2026 15:22:20 -0700 Subject: [PATCH] fix: name hook tags with a dot so pre-commit stops warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pre-commit warns "appears to be a mutable reference (moving tag / branch)" for any rev containing neither a "." nor pure hex — see WarnMutableRev in clientlib.py. It is a naming heuristic, not a real mutability check, but `rev: dead-code-v1` would have printed that warning on every run in all six consumer repos, and told developers the pin is unsupported. Tag is now dead-code-v1.0, verified silent. Documents the constraint in both the README and the script header so the next version does not regress it. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013ZcazeseXVpu8XrYA2tE1V --- README.md | 8 ++++++-- check-dead-code.sh | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 69d4aa1..ca13b2a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ and vendored drift cannot happen: repos: - repo: https://github.com/offworldlabs/ops - rev: dead-code-v1 + rev: dead-code-v1.0 hooks: - id: dead-code @@ -32,7 +32,11 @@ and vendored drift cannot happen: | --- | --- | --- | | `dead-code` | [`check-dead-code.sh`](check-dead-code.sh) | `vulture==2.14` on `PATH` | -Hook versions are published as tags named `-v`. To change a hook: edit +Hook versions are published as tags named `-v.`. **The dot is +required, not cosmetic.** pre-commit warns "appears to be a mutable reference" +for any `rev` containing neither a `.` nor pure hex, so a tag like +`dead-code-v1` makes every consumer print a spurious warning on every run +(`clientlib.py`, `WarnMutableRev`). To change a hook: edit it here, run `bash tests/test-check-dead-code.sh`, merge, tag, then bump `rev` in the consumers (`pre-commit autoupdate` does the bump for you). diff --git a/check-dead-code.sh b/check-dead-code.sh index 5f49b17..a8d604d 100755 --- a/check-dead-code.sh +++ b/check-dead-code.sh @@ -5,11 +5,12 @@ # Consumed by other repos as a pre-commit hook, pinned by rev: # # - repo: https://github.com/offworldlabs/ops -# rev: dead-code-v1 +# rev: dead-code-v1.0 # hooks: # - id: dead-code # -# Do not vendor this file. Change it here, publish a dead-code-v tag, then +# Do not vendor this file. Change it here, publish a dead-code-v. +# tag (the dot matters — pre-commit warns "mutable reference" without one), then # bump rev in the consumers (`pre-commit autoupdate` does that for you). # # check-dead-code.sh # fail if anything unwhitelisted is dead