Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Commit-boundary file snapshots and the pure line diff over them — what lets the generated page re-diff any contiguous commit sub-range without touching git: the CLI collects contents once, the page (via WASM) calls range_diff with a pair of boundary indices.

Nothing here shells out; snapshots arrive as data. Renames are not re-detected inside a sub-range — a rename shows as a delete plus an add.

Structs§

Boundary
The tracked files’ state at one commit boundary.
RangeSnapshots
File contents pinned at every commit boundary of the diffed range, deduplicated by git blob id. Only paths touched by some commit in the range are tracked.

Functions§

diff_lines
Diff two texts line-wise into hunks with context unchanged lines around each change — the same Hunk/Line shapes parse_unified_diff produces. Identical texts yield no hunks.
range_diff
The diff between boundaries from and to (from < to, indices into boundaries), as the same FileDiff shape the build-time parser emits. Selecting commit k alone is range_diff(snap, k - 1, k, …).