-
I am looking for commit stats. like provided by My end goal is to get the line numbers per changed file for all modifications (add, delete, ...). Any tips would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There are Are you looking for the number of deleted/added lines per file for every comnmit? If so, you could probably iterate over all relevant commits with |
Beta Was this translation helpful? Give feedback.
-
thank you! it works now. I did like you suggested and used slightly modified functions from |
Beta Was this translation helpful? Give feedback.
-
Thanks, great to hear that worked. :) |
Beta Was this translation helpful? Give feedback.
There are
porcelain.log()
andporcelain.diff
that provide behaviour similar to "git log" and "git diff".Are you looking for the number of deleted/added lines per file for every comnmit? If so, you could probably iterate over all relevant commits with
Repo.walk
, then generate a diff using the functions in ``dulwich.patch` and then filter the whole patch through something like the diffstat utility (or a homegrown implementation that looks for leading + and - signs) to get the number of changed lines. Let me know if I can provide more specific pointers.