@@ -27,41 +27,41 @@ type Blame struct {
27
27
// Blaming a file is a two step process:
28
28
//
29
29
// 1. Create a linear history of the commits affecting a file. We use
30
- // revlist.New for that.
30
+ // revlist.New for that.
31
31
//
32
32
// 2. Then build a graph with a node for every line in every file in
33
- // the history of the file.
33
+ // the history of the file.
34
34
//
35
- // Each node (line) holds the commit where it was introduced or
36
- // last modified. To achieve that we use the FORWARD algorithm
37
- // described in Zimmermann, et al. "Mining Version Archives for
38
- // Co-changed Lines", in proceedings of the Mining Software
39
- // Repositories workshop, Shanghai, May 22-23, 2006.
35
+ // Each node (line) holds the commit where it was introduced or
36
+ // last modified. To achieve that we use the FORWARD algorithm
37
+ // described in Zimmermann, et al. "Mining Version Archives for
38
+ // Co-changed Lines", in proceedings of the Mining Software
39
+ // Repositories workshop, Shanghai, May 22-23, 2006.
40
40
//
41
- // Each node is asigned a commit: Start by the nodes in the first
42
- // commit. Assign that commit as the creator of all its lines.
41
+ // Each node is asigned a commit: Start by the nodes in the first
42
+ // commit. Assign that commit as the creator of all its lines.
43
43
//
44
- // Then jump to the nodes in the next commit, and calculate the diff
45
- // between the two files. Newly created lines get
46
- // assigned the new commit as its origin. Modified lines also get
47
- // this new commit. Untouched lines retain the old commit.
44
+ // Then jump to the nodes in the next commit, and calculate the diff
45
+ // between the two files. Newly created lines get
46
+ // assigned the new commit as its origin. Modified lines also get
47
+ // this new commit. Untouched lines retain the old commit.
48
48
//
49
- // All this work is done in the assignOrigin function which holds all
50
- // the internal relevant data in a "blame" struct, that is not
51
- // exported.
49
+ // All this work is done in the assignOrigin function which holds all
50
+ // the internal relevant data in a "blame" struct, that is not
51
+ // exported.
52
52
//
53
- // TODO: ways to improve the efficiency of this function:
53
+ // TODO: ways to improve the efficiency of this function:
54
54
//
55
- // 1. Improve revlist
55
+ // 1. Improve revlist
56
56
//
57
- // 2. Improve how to traverse the history (example a backward
58
- // traversal will be much more efficient)
57
+ // 2. Improve how to traverse the history (example a backward
58
+ // traversal will be much more efficient)
59
59
//
60
- // TODO: ways to improve the function in general:
60
+ // TODO: ways to improve the function in general:
61
61
//
62
- // 1. Add memoization between revlist and assign.
62
+ // 1. Add memoization between revlist and assign.
63
63
//
64
- // 2. It is using much more memory than needed, see the TODOs below.
64
+ // 2. It is using much more memory than needed, see the TODOs below.
65
65
func (c * Commit ) Blame (path string ) (* Blame , error ) {
66
66
b := new (blame )
67
67
b .fRev = c
0 commit comments