Skip to content

Commit 2f6786b

Browse files
committed
Use *Blamed File* and *Source File* more consistently
This change also reflects the way `blamed_file` and `source_file` are used throughout the code.
1 parent 6e1ea6d commit 2f6786b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

gix-blame/src/file/function.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ use crate::{BlameEntry, Error, Options, Outcome, Statistics};
3737
///
3838
/// *For brevity, `HEAD` denotes the starting point of the blame operation. It could be any commit, or even commits that
3939
/// represent the worktree state.
40-
/// We begin with a single *Unblamed Hunk* and a single suspect, usually the `HEAD` commit as the commit containing the
40+
///
41+
/// We begin with one or more *Unblamed Hunks* and a single suspect, usually the `HEAD` commit as the commit containing the
4142
/// *Blamed File*, so that it contains the entire file, with the first commit being a candidate for the entire *Blamed File*.
4243
/// We traverse the commit graph starting at the first suspect, and see if there have been changes to `file_path`.
4344
/// If so, we have found a *Source File* and a *Suspect* commit, and have hunks that represent these changes.

gix-blame/src/file/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ use crate::types::{BlameEntry, Change, Either, LineRange, Offset, UnblamedHunk};
88

99
pub(super) mod function;
1010

11-
/// Compare a section from the *Blamed File* (`hunk`) with a change from a diff and see if there
12-
/// is an intersection with `change`. Based on that intersection, we may generate a [`BlameEntry`] for `out`
13-
/// and/or split the `hunk` into multiple.
11+
/// Compare a section from a potential *Source File* (`hunk`) with a change from a diff and see if
12+
/// there is an intersection with `change`. Based on that intersection, we may generate a
13+
/// [`BlameEntry`] for `out` and/or split the `hunk` into multiple.
1414
///
15-
/// This is the core of the blame implementation as it matches regions in *Source File* to the *Blamed File*.
15+
/// This is the core of the blame implementation as it matches regions in *Blamed File* to
16+
/// corresponding regions in one or more than one *Source File*.
1617
fn process_change(
1718
new_hunks_to_blame: &mut Vec<UnblamedHunk>,
1819
offset: &mut Offset,

gix-blame/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
//!
33
//! ### Terminology
44
//!
5-
//! * **Source File**
6-
//! - The file as it exists in `HEAD`.
7-
//! - the initial state with all lines that we need to associate with a *Source File*.
85
//! * **Blamed File**
6+
//! - The file as it exists in `HEAD`.
7+
//! - the initial state with all lines that we need to associate with a *Blamed File*.
8+
//! * **Source File**
99
//! - A file at a version (i.e. commit) that introduces hunks into the final 'image'.
1010
//! * **Suspects**
1111
//! - The versions of the files that can contain hunks that we could use in the final 'image'

0 commit comments

Comments
 (0)