Skip to content

Version refs: support pinning dependencies to git tags, branches, and commits #496

@kasperjunge

Description

@kasperjunge

Summary

Allow dependencies to specify a git tag, branch, or commit SHA in their handle, e.g.:

  • user/skill#v1.0.0 (tag)
  • user/skill#main (branch)
  • user/skill#abc123 (commit)

Currently agr always resolves to the default branch HEAD, which means any upstream push silently changes what you get.

Why

This is a prerequisite for lockfiles, update workflows, and reproducibility. Without version refs, there is no way to pin a dependency to a known-good state.

Scope

  • Extend ParsedHandle in handle.py to parse #ref suffix
  • Extend Dependency in config.py to store the ref
  • Update agr.toml format to support refs in handle strings
  • Update git operations in git.py to checkout specific refs
  • Update agr add to accept and store refs

🤖 Generated with Claude Code

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