Skip to content

Full git clone for single-commit verification is wasteful #5

Description

@lcarva

Description

In verify.py:30-32, every verification clones the entire repository history. For large repos (e.g., CPython, numpy), this downloads hundreds of megabytes unnecessarily.

subprocess.run(
    ["git", "clone", repo_url, str(dest)],
    check=True,
    capture_output=True,
)

Impact

Slow verification for large repositories and potential resource exhaustion.

Suggested fix

  • For tag-based refs: use --depth=1 --branch <tag>
  • For commit SHAs: use git init + git fetch <url> <sha> --depth=1 + git checkout FETCH_HEAD (supported by most major hosts)
  • Fall back to full clone only when shallow strategies fail

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