Available on crate feature
blob only.Expand description
For using text diffs, please have a look at the imara-diff documentation,
maintained by Pascal Kuthe.
Modules§
- pipeline
- platform
- sources
- Modified for gitoxide from the upstream imara-diff crate. Upstream source: git cat-file -p 32d1e45d3df061e6ccba6db7fdce92db29e345d8:src/sources.rs
- unified_
diff - Facilities to render a computed
Diffas unified diff output. Facilities to produce the unified diff format.
Structs§
- Diff
- Represents the difference between two sequences of tokens.
- Diff
Line Stats - Information about the diff performed to detect similarity.
- Driver
- A set of values to define how to diff something that is associated with it using
git-attributes, relevant for regular files. - Hunk
- A single change in a
Diffthat represents a range of tokens (before) in the first sequence that were replaced by a different range of tokens in the second sequence (after). - Hunk
Iter - Yields all
Hunks in a file in monotonically increasing order. Monotonically increasing means here that the following holds for any two consecutiveHunksxandy: - Indent
Heuristic - A slider heuristic that uses indentation levels to determine the best hunk position.
- Indent
Level - Represents the indentation level of a line.
- Interned
Input - Two lists of interned tokens that a
Diffcan be computed from. - Interner
- An interner that allows for fast access of tokens produced by a
TokenSource. - NoSlider
Heuristic - A slider heuristic that doesn’t adjust hunk positions.
- Pipeline
- A conversion pipeline to take an object or path from what’s stored in
gitto what can be diffed, while following the guidance of git-attributes at the respective path to learn if diffing should happen or if the content is considered binary. - Platform
- A utility for performing a diff of two blobs, including flexible conversions, conversion-caching acquisition of diff information. Note that this instance will not call external filters as their output can’t be known programmatically, but it allows to prepare their input if the caller wishes to perform this task.
- Token
- A token represented as an interned integer.
- Unified
Diff - A helper that renders a
Diffas unified diff output. It can be used to create a textual diff in the format typically output bygitorgnu-diffif the-uoption is used.
Enums§
- Algorithm
imara-diffsupports multiple different algorithms for computing an edit sequence. These algorithms have different performance and all produce different output.- Resource
Kind - A way to classify a resource suitable for diffing.
Traits§
- Slider
Heuristic - A trait for heuristics that determine the best position for ambiguous diff hunks.
- Token
Source - A trait for types that can be split into tokens for diffing.
Functions§
- diff_
with_ slider_ heuristics - Compute a diff with Git’s slider heuristics to produce more intuitive diffs.