Skip to main content

Module git

Module git 

Source
Expand description

The Git boundary (spec §4): gix for reads, the git CLI for mutations and network operations. Submodules:

  • cli — the GitCli subprocess trait + RealGit.
  • ops — verb-named wrappers over GitCli for shared mutations.
  • discover — repository discovery and identity via gix.
  • porcelain — pure parsers for git porcelain output.
  • submodule — submodule detection (status) and init (update --init).
  • worktrees — worktree enumeration + missing detection.

Re-exports§

pub use cli::GitCli;
pub use cli::GitOutput;
pub use cli::RealGit;

Modules§

aheadbehind
Ahead/behind computation via git rev-list --left-right --count. Ahead/behind is async-loaded data (spec §10), so this subprocess is outside the synchronous listing fast-path; git rev-list is used for its exact correctness.
cli
The git subprocess boundary (spec §4): state-mutating and network operations shell out to git. The GitCli trait isolates this so tests can inject a fake; RealGit is the production implementation.
commit
Reading commit metadata for display via gix (spec §4): short hash (honoring core.abbrev), subject, author, and timestamp.
discover
Repository discovery and identity via gix (spec §4 read operations): discovery from a directory upward, bare detection, and the current worktree.
porcelain
Pure parsers for git porcelain output (spec §4 sanctioned subprocess reads). Kept separate from the I/O so they are unit-testable on fixed input.
refs
Ref and branch reads via gix (spec §4): local branch listing, upstream resolution, ref resolution, and default-branch resolution.
status
Working-tree status via git status --porcelain (spec §4 sanctioned subprocess read — the read most likely to need a fallback from gix).
submodule
Git submodule detection and initialization (issue #50).
worktrees
Worktree enumeration via git worktree list --porcelain (spec §4 sanctioned subprocess read) plus missing-directory detection.