Crate gix_blame

Source
Expand description

A crate to implement an algorithm to annotate lines in tracked files with the commits that changed them.

§Terminology

  • Blamed File
    • The file as it exists in HEAD.
    • the initial state with all lines that we need to associate with a Source File.
  • Source File
    • A file at a version (i.e., commit) that introduces hunks into the final ‘image’ of the Blamed File.
  • Suspects
    • The versions of the files that can contain hunks that we could use in the final ‘image’
    • multiple at the same time as the commit-graph may split up.
    • They turn into a Source File once we have found an association into the Blamed File.

Structs§

BlameEntry
A mapping of a section of the Blamed File to the section in a Source File that introduced it.
BlamePathEntry
Represents a change during history traversal for blame. It is supposed to capture enough information to allow reconstruction of the way a blame was performed, i. e. the path the history traversal, combined with repeated diffing of two subsequent states in this history, has taken.
BlameRanges
A type to represent one or more line ranges to blame in a file.
Options
Options to be passed to file().
Outcome
The outcome of file().
Statistics
Additional information about the performed operations.

Enums§

Error
The error returned by file().

Functions§

file
Produce a list of consecutive BlameEntry instances to indicate in which commits the ranges of the file at suspect:<file_path> originated in.