Expand description
strop-git: the working surface (0001 pillar 3.1). libgit2 for the hot paths — no process spawn per keystroke. HEAD vs the live buffer (not the disk file), so gutter signs track unsaved edits.
The typed model is shared across backends (0036 RW8, 0037 DC1b): the
local libgit2 repository (Repo), the read-oriented remote
backend (remote) — bounded git commands against a worktree
that exists only on an strop_workspace::RemoteEndpoint — and
the read-oriented in-container backend (container): bounded
git runs via the local engine’s docker exec, parsed by the same
wire parsers as the remote path. RepoTarget is the boundary that
keeps a non-local workdir from ever reaching a local Git call.
Re-exports§
pub use exec::GitExec;pub use exec::GitExecError;pub use exec::GitRun;pub use target::RepoTarget;
Modules§
- container
- The read-oriented container Git backend (0037 DC1b): the same
bounded
gitqueries as the remote backend, executed inside a running container through the local engine’sdocker exec(GitExec::Container) and parsed by the same wire parsers — discovery and context are the exec-generic cores shared withcrate::remote, so no parsing or exit-code mapping is duplicated here. Like the remote path, no mutation verbs exist: container repositories are read-only. - exec
- Three real Git execution backends (0036 RW7/RW8, 0037 DC1b): local
gitvia std::process with-C workdir, bounded remotegitvia the shared remote-execution boundary (strop_remote::run), and bounded in-containergitviadocker execargv throughstrop_containers::exec_capture. Not a provider framework — the enum’s variants are every backend that exists. - memory
- Git memory (M3, 0001 pillar 3.2/3.3): log graph, blame, changed-file
stats. Reads run through
GitExec— localgitor bounded remotegitover the shared execution boundary (0036 RW8) — with one argv builder and one structured parser per query, so both backends admit exactly the same machine formats. Permalinks and remote normalization live inpermalink/ssh(0033 finding 1). - permalink
- Permalink remote normalization and URL construction (0001 pillar
3.3, 0033 finding 1). Everything here is pure — no filesystem, no
environment, no process. SSH aliases come back to the caller as
unresolved data; OpenSSH effective-configuration evaluation lives
in
crate::sshand is owned IO-worker work, never this module. - remote
- The read-oriented remote Git backend (0036 RW8): bounded
gitcommands 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). - ssh
- OpenSSH effective configuration (0033 finding 1): an SSH alias’s
real hostname is what
ssh -Gsays —Include, wildcardHostandHostNamerules included — not what a partial home-grown parser guesses from~/.ssh/config. - target
- The typed repository boundary (0036 RW8, 0037 DC1b): every Git
request names the machine its worktree lives on. A local workdir is
openable with libgit2 and local
git; a remote workdir is bytes on another host and only bounded remotegitcommands can read it; a container workdir is bytes inside a running container and only boundeddocker execruns can read it. Keeping the three in one enum — instead of a bare path that could mean any of them — makes “treated a non-local path as local” a type error instead of a bug.
Structs§
- Diff
Line - One line of a hunk: content without prefix, plus the 1-based line
number on each side that has one (absent side:
None, never0). - File
Diff - One file’s diff at a commit (vs its parent): the delta view’s data.
- GitContext
- The pure cached view of a repository (R6): no libgit2 handle, no locks, no IO to read — render and command decisions consult this, while every native read runs on a worker. Equality is meaningful: an unchanged context (same HEAD, branch, remotes) means cached diffs stay valid.
- Hunk
- One diff hunk between two versions of a file, in 1-based lines.
- Repo
- Source
Location - A revisioned source location (0014 wave 4): permalinks, jumps into history, and blame’s parent-hop all speak this — no more “permalink from a historical view links HEAD’s file”.
Enums§
- GitError
- Why a repository operation failed — typed, not a string and not an empty Vec standing in for “something went wrong” (R9).
- GitRevision
- Hunk
Kind - Line
Origin - Where a diff line comes from — addition/deletion carry which side’s
line number applies (0010 §1: typed origins, never
+-sniffing). - Sign
- One changed line, for gutter signs. Hunk headers include context lines, so signs track the +/- lines, not the header range.