Skip to main content

Crate lattice_vcs

Crate lattice_vcs 

Source
Expand description

Pure git data layer — read + write operations over a git repository.

Wraps [gix] for repository interaction, providing a typed API surface consumed by the VCS subsystem (lattice-host::vcs) and the magit feature buffer modes (lattice-magit).

Zero lattice-* dependencies. Only gix, ropey, smallvec, thiserror.

§Example

use lattice_vcs::{Repository, WorkingTree};

let repo = Repository::discover(".").unwrap();
let statuses = WorkingTree::statuses(&repo).unwrap();
for (path, status) in statuses {
    println!("{}: {:?}", path.display(), status);
}

Structs§

Bisect
Bisect operations — start, good, bad, skip, reset, and reading the state of a bisect already in progress.
BisectState
A bisect in progress.
Branch
Branch operations — checkout, create, delete.
Commit
Commit operations — create and amend commits.
GitBlob
Read the content of a git blob (file at a specific revision).
Index
Index (staging area) write operations.
Note
Git-notes operations.
PathChange
A path’s porcelain XY status, kept as the TWO independent axes git reports rather than collapsed into one value.
RefEntry
One ref, and where it points.
Reference
Reference operations — resolve a named ref to an object id.
Remote
Remote management — list, add, rename, remove, set-url, prune.
RemoteEntry
A single configured remote.
Repository
Wraps a [gix::Repository], representing an open git repository.
Stash
Stash operations — list, apply, pop, drop, create.
Submodule
Submodule operations — list, add, update, sync, remove.
SubmoduleEntry
One configured submodule.
WorkingTree
Working tree and index status operations.

Enums§

BisectStep
NC.6: what one bisect step did, read from git’s own report.
InFlightOp
A multi-commit operation stopped mid-flight.
NoteMergeStrategy
How git notes merge resolves a conflict. Magit offers the same set, which is git’s own.
PathStatus
One axis of a path’s change, as git reports it.
RefKind
What kind of thing a ref is. The three groups magit’s refs buffer shows, in the order it shows them.
SubmoduleState
What git submodule status reports about one submodule.
UnmergedKind
Which unmerged combination git reported.
VcsError
Error type for all lattice-vcs operations.

Functions§

parse_bisect_step
Parse the stdout of git bisect start|good|bad|skip.
parse_bisect_vars
Parse git rev-list --bisect-vars output into (revisions_left, steps).
parse_for_each_ref
Parse [REF_FORMAT] output into entries.
parse_remote_v
Parse the output of git remote -v.
parse_submodule_status
Parse git submodule status output.

Type Aliases§

Result
Convenience result type alias.