Expand description
The read-oriented remote Git backend (0036 RW8): bounded git
commands against a worktree that exists only on an SSH endpoint,
executed through the shared remote-execution boundary and parsed by
the same structured parsers as the local backend. No libgit2 here —
no remote filesystem is ever assumed local — and no mutation verbs
exist on this path at all (RW4 keeps remote repositories read-only).
Every machine-format boundary (ls-tree/ls-files records,
rev-parse output, config -z remotes, rev-list --parents) is a
pure parser fed by bytes captured from real git, so native —
possibly non-UTF-8 — filenames stay worktree identities and exit
codes carry the meaning instead of stderr matching. Unborn HEAD and
absent paths are honest Nones; transport, tooling and truncation
failures are typed errors.
Structs§
- File
Contents - HEAD’s and the index’s blob bytes for one repo-relative path — the
gutter diff’s inputs.
head_shais the context’s resolved HEAD (an unborn repository passesNoneand HEAD is not asked). Absent from HEAD’s tree / absent from the index are honestNones.
Enums§
- Remote
GitError - Why a remote Git query failed — typed at this boundary, never a bare string and never an empty list standing in for “failed”.
Functions§
- commit_
file_ diff - One file’s structured delta at
shaagainst its first parent (root commits diff against empty): the dive view’s data, built from the two blobs and the same hunk builder the local libgit2 path uses. - context
- The pure cached context of a remote repository (R6): HEAD sha,
branch and remotes captured once on a worker. Unborn HEAD and
detached HEAD are honest
None/name states, distinguished by exit code — never by stderr text. - discover
- Discover the repository containing a remote directory.
Ok(None)is the honest “no repository here” — git’s own not-a-repository fatal — while transport failures, missinggit/python3 and corrupt repositories are typed errors. The returned workdir is a path on the endpoint, native bytes, never a local path. - effective_
host - Resolve an SSH alias against OpenSSH’s effective configuration on
the endpoint (
ssh -Grun remotely): the alias belongs to the machine whose remote carries it, and evaluating it with the local user’s config would answer for the wrong host. Owned worker work, cancellable like every bounded remote run. - file_
contents - One file’s HEAD/index blob bytes via machine-readable presence
checks (
ls-tree/ls-files,-z, literal pathspec) followed bycat-fileon the recorded oid — never a:pathspelling whose absence would need stderr matching to interpret. - gutter
- Fetch a file’s HEAD and index contents and assemble the gutter’s
typed hunk sets against the live buffer text — the same semantics
crate::Repo::unstaged_hunks/[staged_hunks]/[is_untracked] give local buffers, from bounded remote reads. Untracked files report one all-add hunk, matching local behavior.