diff
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| DiffLine acptui.protocol.diff One line of a hunk with its line numbers (``None`` on the side it is missing from). |
||
| FileDiff acptui.protocol.diff The changes of one file. |
||
| Hunk acptui.protocol.diff A hunk: a run of changed lines with context. |
🛈 DocStrings¶
Parsing git_patch text (diff --git sections) into files, hunks and lines.
DiffLine
dataclass
¶
One line of a hunk with its line numbers (None on the side it is missing from).
Source code in src/acptui/protocol/diff.py
FileDiff
dataclass
¶
The changes of one file.
Source code in src/acptui/protocol/diff.py
Hunk
dataclass
¶
parse_patch
¶
parse_patch(text: str) -> list[FileDiff]
Parse unified / git patch text. Unknown lines are skipped, never fatal.
Source code in src/acptui/protocol/diff.py
side_by_side
¶
Pair a hunk's lines for a split view: removals next to the additions replacing them.