The goal
I am building a git stats script in Python that can only access the historical git diff patches, so basically files like this
diff --git a/README b/README
index 980a0d5f..fef29374 100644
--- a/README
b/README
@@ -1 1,3 @@
Hello World!
Hello planet! - DD
\ No newline at end of file
What do I want exactly?
- Take a list of git diff files as input
- Calculate how many lines were changed (optional), added and removed in each diff file
- Sum it all up
- Print "total lines added = X, total lines removed = Y" etc.
Constraints
The system running this script does not have access to the git repository, nor does it have git installed - introducing an interesting complication.