Here's a stab at a starting point, though there's probably more to do:
git rev-list --branches --parents |
while read hash parents; do
# $hash is a commit; it has $parents as its parents
set -- $parents
for p do # loop over all of $hash's parents
git diff $p $hash --stat -- $pathlimiters
done
done | awk '/files changed, / { print }'
The output will have many lines of the form:
2 files changed, 10 insertions(+), 1 deletion(-)
3 files changed, 924 insertions(+), 550 deletions(-)
Modify the awk
code (or write something in whatever language you prefer) to find the insertions and deletions counts and sum them up.
You also probably need to add a special case for root commits (when $parents
is empty) where you diff against the empty tree.