Skip to content

sync: repo names starting with http/git/svn/hg are unmatchable by name #559

Description

@tony

vcspull sync <name> silently matches nothing when the repository's name begins with http, git, svn, or hg. The same name resolves fine under list and search, so the config is valid — only sync can't reach it.

Reproduction

Config:

~/code/:
  httpx: git+https://github.com/encode/httpx.git
  flask: git+https://github.com/pallets/flask.git

list finds it:

$ vcspull list -f repro.yaml httpx
• httpx → ~/code/httpx

sync does not:

$ vcspull sync -f repro.yaml --dry-run httpx
✗ No repo found in config(s) for "httpx"
Plan: 0 to clone (+), 0 to update (~), 0 unchanged (✓), 0 blocked (⚠), 0 errors (✗)
No repositories matched the criteria.

A name without one of those prefixes works as expected:

$ vcspull sync -f repro.yaml --dry-run flask
Plan: 1 to clone (+), 0 to update (~), 0 unchanged (✓), 0 blocked (⚠), 0 errors (✗)

~/code/
  + flask  ~/code/flask  missing

Cause

sync classifies each positional pattern as a path, a VCS URL, or a name before handing it to filter_repos. The URL branch tests a bare prefix, so any name beginning with one of those four strings is routed to the vcs_url filter and compared against git+https://…, which never matches:

https://github.com/vcs-python/vcspull/blob/v1.65.0/src/vcspull/cli/sync.py#L1499-L1508

The prefixes are matched against the whole pattern rather than a URL scheme, so the test is true for httpx just as it is for https://….

Affected names

Any repository whose name starts with http, git, svn, or hg — for example httpx, httpie, gitui, gitleaks, gitea, hg-git. These are ordinary project names, and nothing in the config or the error message hints at why they can't be synced.

Notes

The error path is quiet about the cause: it reports the pattern as an unmatched name (No repo found in config(s) for "httpx") even though the pattern was actually interpreted as a URL. Whatever the fix, echoing back how the pattern was classified would make this class of failure self-explanatory.

Workaround: scope by workspace instead of by name, e.g. vcspull sync -w ~/code --all.

Discovered while recording CLI demos against a config containing httpx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions