Repository navigation
Replies: 1 comment 1 reply
|
Thanks, as I mentioned in #1178, I’m hesitant to introduce more ambiguity for now. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
This is a follow-up to #2513 and #2659. Extend the repeatable
prek run --repo <REPO>option to accept a bare GitHub repository name, such as--repo quality-hooks, when that name resolves unambiguously across the selected workspace projects.Example
Usage
Run every configured hook from the uniquely matched repository:
$ prek run --all-files --repo quality-hooksThe bare form should remain repeatable and compose with existing repository selectors:
$ prek run --all-files --repo local --repo meta --repo builtin --repo quality-hooksUse
OWNER/REPOSITORYor a complete URL when the bare name is ambiguous:Required behavior
Repository resolution
.gitmatches the bare name without.git..gitis treated as a literal repository name, not as an optional suffix for the selector.rev.OWNER/REPOSITORYidentity across projects, revisions, URL forms, or casing are one match, and all corresponding entries are retained.Ambiguous names
If selected projects configure both
example-org/quality-hooksandanother-org/quality-hooks,--repo quality-hooksmust fail instead of selecting both or choosing the first match.--skip, group filters, stage selection, and file filtering.repo: quality-hooksand a derived GitHub identity such asexample-org/quality-hooksare distinct identities and therefore ambiguous.--repo quality-hooks --repo example-org/quality-hooksmust still reject--repo quality-hooks.1, list every matching identity and its selected workspace project paths, and suggest usingOWNER/REPOSITORYor a complete URL.Special repository names
local,meta, andbuiltinneed explicit collision handling:repo:entry exists, preserve the current special-repository selection.OWNER/REPOSITORYor its complete URL.--repo example-org/builtinselects the configured remote repository and remains independent of any runtime builtin fast path.Hook ID conflicts
Repository selectors and positional hook selectors remain separate namespaces, even when their values are identical:
The first command selects every hook from repository
quality-hooks. The second selects hook IDquality-hooksacross repositories. The third selects their intersection, meaning hook IDquality-hooksonly within repositoryquality-hooks.--skip quality-hookscontinues to skip a hook or project selector and must not be reinterpreted as a repository exclusion.Existing filter behavior
--skip, group filters, stages, and file-selection modes.Implementation constraints
OWNER/REPOSITORYidentity before constructing repository initialization plans.prek runand the existing implicit top-level run interface. Do not expose it throughtry-repo,list,exec, installation commands, or Git hook shims.References
--repoCLI Flag toprek runfor repository-level hook selection #2659All reactions