The currentreader.parse_history usescommit.stats.files[file], which has additions deletions stats of the commit. But the file name follows the => pattern for renamed files and this involves string manipulation to parse old and new names. The current parsing relies on git out pattern of { => } for renaming. A more robust way may be to use GitPython's functionality.
Investigated the commit.diff([parent_commit]) function. This returns a diff object that has a_path for the old name and b_path for the new name after the commit. But the stats are in the diff attribute like @@ -1,19 +1,21 @@\n ---\n... which involves more string manipulations to parse the stats.
The current
reader.parse_historyusescommit.stats.files[file], which hasadditionsdeletionsstats of the commit. But the file name follows the=>pattern for renamed files and this involves string manipulation to parse old and new names. The current parsing relies on git out pattern of{ => }for renaming. A more robust way may be to use GitPython's functionality.Investigated the
commit.diff([parent_commit])function. This returns a diff object that hasa_pathfor the old name andb_pathfor the new name after the commit. But the stats are in thediffattribute like@@ -1,19 +1,21 @@\n ---\n...which involves more string manipulations to parse the stats.