On this page

0242. Git as a first-class package source; editions unchanged

Context

ADR-0209 kept pinned git dependencies only as a legacy escape hatch and required published packages to replace git deps with registry or edition deps. Maintainer wants direct installs from GitHub. Today crates/harness/src/manifest.rs:368-379 accepts only a full 40-hex rev (E0933), and fetch_git (crates/harness/src/packages.rs:556) runs a full git clone --no-checkout through the hardened git subprocess. ADR-0160 says harness vc does not read or write git formats or protocols; 0204 repeats that for the hvc wire.

Decision

Git is a first-class source, including inside published packages. Add util = { git = "<url>", tag = "v1.2.0" } beside the existing rev form. Fetch resolves the tag with git ls-remote (peeled), fetches that commit with --depth 1, falls back to a full clone when the server refuses unadvertised wants, verifies the commit, strips .git and records tree_hash. The tagged manifest's version must equal the tag's x.y.z. The lock records commit, tag and hash (0240); a moved tag is an error. v<x.y.z> tags are versions for MVS (0239). harness add github.com/acme/[email protected] writes the manifest only.

The client keeps shelling out to the git CLI. No git library, no git object or wire code in Harness, no git-backed registry or index. ADR-0160 and 0204 are unchanged: they govern hvc's own format and wire, not which hosts the package client may read from.

Embedded editions stay offline and byte-identical (ADR-0089). Releases record their edition; registry releases never join an edition automatically.

Alternatives considered

Consequences

Installing from GitHub works in Phase 0, before any registry exists. Clients need git for git sources only. First fetch of a tag is trust-on-first-use until the VCS host's checksum log (0244); GitHub-hosted packages are not covered by that log unless mirrored.