Skip to content

fix(lookup): a pre-commit rev naming a branch is left alone, not an error - #253

Merged
sweepies merged 1 commit into
mainfrom
fix/precommit-branch-rev
Nov 11, 2026
Merged

sweepies merged 1 commit into
mainfrom
fix/precommit-branch-rev

Conversation

@sweepies

@sweepies sweepies commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Bug 5 from design consult 4.

pre-commit allows any git ref as rev. Tags and SHAs are recommended; a branch works but is mutable. precommit.rs skips commit hashes, but a rev: main reached lookup and failed with "cannot classify current value".

pre-commit now joins the rule that looks a ref up only when it is a version (needs_lookup, crates/lookup/src/lib.rs), and the opaque-ref return in evaluate_with. A non-version rev gets no catalog fetch, no error and no update, the same treatment GitHub Actions branch refs get. Version tags are looked up as before.

Test: pinned_precommit_branch_rev_is_an_error becomes a_precommit_branch_rev_is_an_opaque_ref. For rev: main it asserts no lookup, Ok and no updates; for rev: v4.5.0 it asserts a lookup.

Corpus snapshot: unchanged. Every pre-commit rev in the corpus is a version tag.

Docs: the pre-commit paragraph in guide/managers.md. The new behaviour matches what a Renovate user expects, so no departure entry is needed.

View guided diff Turn on auto-fix

A rev naming a branch is not a commit hash, a tag or a GitHub Actions
ref, so it reached "cannot classify current value" as an evaluation
error. pre-commit accepts any git ref; like a GitHub Actions branch ref,
a non-version rev now has no lookup and no error.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula d46f71b Commit Preview URL

Branch Preview URL
Nov 11 2026, 07:10 AM

@sweepies
sweepies merged commit 8509985 into main Nov 11, 2026
13 checks passed
@sweepies
sweepies deleted the fix/precommit-branch-rev branch November 11, 2026 07:28
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant