as a personal project, I'd like to check different python libraries and projects (be it proprietary or open source) and analyze how the code was changed over time in different releases to gather some info about the technical debt (mainly through static code analysis). I'm doing this using gitpython
library. However, I'm struggling to filter the merge commits to the master
.
I filter the merge commits using git.log("--merges", "--first-parent", "master")
from where I extract the commit hashes and filter these particular commits from all repository commits.
As the second part, I'd like to get all changed files in each merge commit. I'm able to access the blobs via git tree, but I don't know how to get only changed files.
Is there some efficient way how to accomplish this? Thanks!
Once you have your commit list as you described above, loop over them and run the following:
git diff
Use the
git diff
with the--name-only
flaggit diff