diffparser
diffparser copied to clipboard
Translate original line number to current file and vice-versa
I am currently working on a differential test coverage analysis tool. It requires having the diff of the changes to detect which lines of code's coverage have changed and keeping track of line numbers between two source file versions.
This pull requests adds a feature to support my use-case.
To explain my test, take the following diff:
diff --git a/file1 b/file1
index 504d2a1..50ccec3 100644
--- a/file1
+++ b/file1
@@ -1,4 +1,4 @@
+add a line
some
lines
-in
file1
The 1st line in the original was "some", but is translated to the 2nd line in the new version because of the new line "add a line".