Skip to main content

Module diffalgo

Module diffalgo 

Source
Expand description

Selectable line-diff algorithms, shared by every diff source. Myers, Minimal and Patience are git2’s own (see crate::git); Histogram and Structural (which layers reformat detection on top, in crate::syntax::intraline) run through imara-diff, since libgit2 has no histogram implementation.

Structs§

DiffSettings
The line-diff context, algorithm and indent heuristic every diff source honours, threaded through construction so the review’s long-lived backend and every worker that opens a fresh one read the same values and can never drift apart.

Enums§

DiffAlgorithm

Functions§

histogram_hunks
Line hunks of old vs new computed by imara-diff’s histogram algorithm, grouped with context unchanged lines around each change the way git itself merges nearby hunks together (mirrors imara-diff’s own unified_diff grouping rule, without needing its text printer). file_path seeds the hunk ids the same way crate::git does, so staging can find the hunk it shows regardless of which algorithm produced it, as long as both read the current algorithm.