Skip to main content

Module git_diff

Module git_diff 

Source
Expand description

Git diff snapshot types.

Type-only - the scanner that produces these lives in forge_agent::env::git_diff::scan. The four shapes cross every forge-* crate boundary (agent produces, workspace mediates, a view renders), so they live in primitives per the crate placement guide. Sibling git types (GitBranch, GitPrInfo, GitIssueRef) live in crate::git.

Re-exports§

use crate::git::GitBranch; 🔒
use crate::git::GitIssueRef; 🔒
use crate::git::GitPrInfo; 🔒
use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒

Structs§

GitBranchAhead
Layer 2 payload: how far the branch is ahead of the default branch, alongside the corresponding numstat.
GitDiffFile
One file’s diff stats. added / removed are git’s --numstat line counts; binary files (which numstat reports as -) are dropped by the parser rather than appearing here.
GitDiffSnapshot
Snapshot of one project’s git state, suitable for rendering in the Inspector pane’s GIT section. Branch info is folded in here so a single polled scan covers everything the renderer needs.
GitDiffStats
Per-file numstat plus aggregate totals for one diff layer. Shared between GitDiffSnapshot::worktree (layer 1, HEAD vs workdir) and GitBranchAhead::stats (layer 2, default vs branch tip).
GitWorkView
The tree behind a git row’s depth, bundled: what a hover over the row draws beyond the branch and the count.

Enums§

BaseState
How current the base a drawn branch diff was measured against is.
LayerState
Per-layer scan state. Replaces the earlier parallel-bool encoding (Option<T> paired with a *_scan_ok: bool) so the three legal states are unrepresentable as illegal combinations.
PrRefresh
Whether a scan may reach the network for its PR block.
RepoGate
Three-state classification of the scan’s repo gate. Replaces the earlier in_repo + scanner_ok bool pair so the illegal “in a repo but the scanner failed” combination is unrepresentable.