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_all_withwith signature verification on — the CLI’s default (issue #692). Existing in-process callers (the integration-test suite) that construct only validly-signed histories are unaffected.- fetch_
all_ with 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>.- is_
fast_ forward - True iff advancing a ref from
oldtonewis a fast-forward (i.e.oldis an ancestor ofnew). A missingold(brand-new ref) and an unchanged ref both count as fast-forwards. Used bypush/fetchto pick the git-style summary symbol (..vs.../(forced update)). - 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 with no SSH trust-pinning.
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 pull_all_withwith signature verification on — the CLI’s default (issue #692). Existing in-process callers (the integration-test suite) that construct only validly-signed histories are unaffected.- pull_
all_ with - 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. Returns the count of refs pushed. Each branch is published withpush_branch, which sends one delta-compressed pack of the objects the remote lacks, advertises it via therefs/mkit/packmap/<branch>ref, then moves the branch ref. - 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 one or more delta-compressed packs carrying
every object reachable from
tipthat the remote lacks — split across multiple packs when the plan’s payload exceeds a single pack’s cap (issue #831) — durably advertise them as one node on therefs/mkit/packmap/<branch>metadata ref, 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. - push_
branch_ with_ depth push_branchwith an explicit re-baseline threshold in place of the configured one (packmap::rebaseline_depth: theMKIT_PACK_REBASELINE_DEPTHenv var, default 64).0disables re-baselining. Semantics are otherwise identical — seepush_branch.- push_
branch_ with_ limits push_branch_with_depthwith an explicit per-pack payload cap in place of the format’s hardcodedpack::MAX_TOTAL_PAYLOAD(issue #831). Semantics are otherwise identical — seepush_branch.