Expand description
Stable identifiers for structured diff hunks (patch selection in later steps).
Ids hash side, path, and hunk line bodies (not line numbers) so they stay stable when earlier hunks are staged and later hunks shift in the file.
Structs§
- HunkId
- Twelve lowercase hex characters identifying one structured hunk within a side and path.
Enums§
- Diff
Side - Which tree/index/worktree sides a hunk was produced from.
- Hunk
IdError - Parse or format failure for
HunkId.
Functions§
- hunk_
ids - Stable ids for
hunksin file order (0-based index matches vector position). - hunk_
ids_ with_ duplicate_ peers - Like
hunk_ids, butpeer_hunkson the same path (typically the other index/worktree side) participate in duplicate-body detection so ids stay stable when an earlier identical hunk moves to the staged side. - peer_
hunks_ by_ primary_ path - Keep structured peer hunks only for paths present in the primary side.
- peer_
scope_ includes_ path - True when a diff entry’s displayed or old path is listed in the primary change set.