Skip to main content

Module diff

Module diff 

Source

Modules§

untracked

Structs§

DiffData
Top-level parsed diff result.
DiffFile
One changed file in the diff.
DiffLine
A single line within a hunk.
DiffSegment
A segment of a line for word-level inline diff highlighting.
Hunk
One @@ hunk section within a file.

Enums§

LineType
Whether a diff line is added, removed, or context.
SegmentTag
Whether a segment is unchanged or changed in an inline diff.

Functions§

parse
Parse raw git diff HEAD -M output into structured DiffData.
parse_with_untracked
Append synthetic diff for untracked files to a raw diff string, parse the combined result, and mark the untracked files in the returned DiffData.
parse_with_untracked_paths
Same as parse_with_untracked but accepts pre-discovered untracked paths. Returns (diff_data, combined_raw_diff).