Expand description
URL-scheme → Transport dispatch for mkit push / mkit pull.
The Rust binary wires all five shipping schemes here: mkit+file://,
mkit+https:// (and mkit+http:// for local dev), mkit+s3://, and
mkit+ssh://. The memory transport is in-process only, so it is
reached via push_all / pull_all with an Arc<MemoryTransport>
constructed in-process rather than URL-based construction. Integration
tests in the mkit-cli crate exercise the memory path directly.
Credentials / environment sources:
- HTTP(S): optional
MKIT_API_TOKENbearer. - S3/R2:
MKIT_R2_ACCESS_KEY_ID+MKIT_R2_SECRET_ACCESS_KEY(plus optionalMKIT_R2_REGION, defaultauto). Missing creds do NOT fail at connect time; the first signed request returnsTransportError::AccessDenied. - SSH: spawns
ssh(1)subprocess — inherits the user’s agent / keys /~/.ssh/config. Per-repo.mkit/configSSH options (host-key checking, known-hosts path, identity file) are wired through viaSshTransport::connect_with_optionswhen config is loaded.
Enums§
- Dispatch
Error - Errors returned by the push / pull helpers. Mapped to exit codes by the commands themselves.
- Push
Lease - CAS lease policy for a default (current-branch → upstream) push.
Functions§
- fetch_
all fetch—pull_allwithout the HEAD update. Downloads every object reachable from each remote ref (viaTransport::download_packon the object’s own digest) and writes the ref intorefs/remotes/default/<branch>.- lease_
condition - Resolve the CAS condition for a single-branch push from the local
remote-tracking ref
refs/remotes/<remote>/<branch>and the lease policy. - open
- Open a transport for the given URL. Returns a type-erased
Arcso callers can treat all schemes uniformly. - open_
trusted - Open a transport for
endpointonly after the per-endpoint credential-trust gate (#97) approves it. - pull_
all - Fetch remote refs, then fast-forward the current local branch from
refs/remotes/default/<branch>. Fresh repos with no local branch tip initialise from the current branch’s remote-tracking ref, or the first advertised remote branch when the current default branch is absent. - push_
all - Push every ref under
refs/heads/to the remote, assembling a pack of every object reachable from the branch tip that the remote does not already hold. Returns the count of refs pushed. - push_
all_ with - CAS-aware mirror push (
mkit push --all). Pushes every localrefs/heads/*to the remote, using the remote-tracking ref underrefs/remotes/<remote>/<branch>as the CAS lease (Missing when no tracking ref exists, Match otherwise).forceupgrades every write to an unconditionalAny. On success each pushed branch’s remote-tracking ref is advanced to the pushed tip. - push_
branch - Push one branch: upload every object reachable from
tipthat the remote lacks, then CAS-writerefs/heads/<branch>undercondition. - push_
branch_ tracked - Push the current branch to its upstream and, on success, advance the
local remote-tracking ref
refs/remotes/<remote>/<branch>to the pushed tip.