Skip to content

add/discover: --pin <commit|tag|branch> to record a fixed ref #551

@tony

Description

@tony

Summary

When importing an existing checkout, add and discover capture only the repository URL — not the currently checked-out ref. There's no per-repo rev field and no CLI option to pin a repo to a specific commit/tag/branch, so a config can't capture a reproducible snapshot.

Note: the existing options.pin is a config-mutation guard (it stops re-import/overwrite of an entry), not a git ref pin. The two are easy to confuse — this request is specifically about pinning the checked-out revision.

Current behavior (v1.60.1)

The backend already supports it (libvcs v0.41.0)

  • GitSync(rev=…) / GitSync.from_pip_url('…@<rev>'); update_repo() checks out the requested rev (src/libvcs/sync/git.py).

Proposal

  1. Add --pin [<ref>] to add and discover:
    • with no value: capture the current ref (git rev-parse HEAD, or the symbolic tag/branch when checked out on one);
    • with a value: pin to the given commit/tag/branch.
  2. Persist as a per-repo rev: key, plumbed to GitSync(rev=…) on sync.

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions