Skip to main content

Crate facett_git

Crate facett_git 

Source
Expand description

facett-git — a facett Facet that shows a git repository: its branches, the commit log, the file tree, and syntax-coloured source — all clickable. A consumer (e.g. nornir’s viz) drops it into a FacetDeck to surface git for any repo.

  • The repository data is a pure RepoSnapshot (branches / commits / tree). With the gix feature it is read live from disk via RepoSnapshot::open; without it the host supplies a snapshot (and a blob), so the facet builds and tests with no git dependency.
  • Source is rendered with a deterministic Rust [highlight]er into an egui LayoutJob (egui can render coloured Rust text — this is how).
  • Everything observable (selected branch, open path, counts) is in state_json (LAW 6 / FC-6), so it is headless-testable.

Re-exports§

pub use highlight::highlight;
pub use highlight::Kind;
pub use highlight::Span;
pub use model::Blob;
pub use model::Branch;
pub use model::CommitRow;
pub use model::RepoSnapshot;
pub use model::TreeEntry;

Modules§

highlight
Deterministic Rust source syntax highlighter → coloured spans an egui LayoutJob can render. Pure (no egui, no I/O), so it is unit-tested without a window and produces bit-identical spans for the same input (FC-7). A tiny hand-written tokenizer — not a full parser — classifying the things that matter for reading code: keywords, types, strings/chars, line+block comments, numbers, attributes, and punctuation.
model
Pure git snapshot model — the data a crate::GitView renders: branches, the commit log, and a directory listing of the tree. The data types are always available + serializable (so the facet builds, tests, and state_jsons with no git dependency); the live reader [RepoSnapshot::open] is gated behind the gix feature.

Structs§

GitView
The git repository facet.
Theme
Colours for each syntax Kind. Default is a dark theme.