Skip to main content

Module diff

Module diff 

Source
Expand description

Structured unified-diff parser: one parse feeds the JSON API’s files[] -> hunks[] -> lines[] shape (and, later, the compare and pull request views).

Follows the JSS forge parsePatch contract by name: each file is {name, binary, adds, dels, hunks}; each hunk {header, lines}; each line {type: add|del|ctx|meta, oldLine, newLine, text}.

Structs§

DiffLine
One line of a hunk.
FileDiff
One file of a patch.
Hunk
A @@ -a,b +c,d @@ hunk.

Enums§

LineKind
Kind of a diff line.

Functions§

parse_patch
Parse a git show --patch / git diff unified patch.