On Tue, Oct 17, 2023 at 07:37:46PM +0800, Hongyi Zhao wrote: > I want to calculate a certain developer's contribution based on > different standards of code line count and the importance of the code. I agree with brian that "number of lines added/removed" is not a perfect measure of productivity ;-). But I think that there is a slightly cleaner way to compute the result you're after, like so: git rev-list --author="$who" origin/main | git diff-tree --stdin -r --numstat --no-commit-id | awk '{ s += $1 + $2 } END { print s }' Thanks, Taylor