I have a file that has a list of commit ids in it and I’m trying to write a script that calculates the number of lines in each commit. What is the easiest/best way to do this? I already have a few lines of python written, but I’m open to any language really.
Share
Use
--numstat(for per-file changes) or--shortstat(for the sum of the changes) as an argument togit show,git log, orgit diff-tree.For example, in bash:
Note that the various diffstat flags can be passed to almost any git command that examines a commit, but they are only documented in the man page of git-diff-tree.