Skip to main content

Module diff

Module diff 

Source
Expand description

The diff document: what a build extracted from git, plus the parser that turns raw git diff text into typed data.

parse_unified_diff is a pure function &str -> Vec<FileDiff> — the CLI feeds it git diff --no-color --no-ext-diff --find-renames output. Nothing here shells out.

Structs§

Commit
One commit in the diffed range.
DiffDocument
The immutable build artifact: one rendered diff between two pinned refs.
FileDiff
One file’s change. old_path/new_path are None where the file does not exist on that side (added / deleted).
Hunk
One contiguous run of diff lines.
NotesFile
A notes file lifted out of the diff and presented as a page panel.

Enums§

FileStatus
How a file changed. Serialized as the bare CamelCase variant name ("Added" / "Deleted" / "Modified" / "Renamed").
Line
One diff line. Encoded as a single-key union — { "Add": { "new": 2, "text": "…" } } — with no discriminator field. Line numbers are 1-based and refer to the side named by the field (old = pre-image, new = post-image) — the same coordinates comments anchor to.

Functions§

parse_unified_diff
Parse git diff unified output (with --find-renames) into typed files.