Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 30, 2023, 21:49 UTC
- Message-ID
- <ZUAk6dPJyhfb7UBM@nand.local>
- In-Reply-To
- <CAGP6PO+SeZPzD21nErX=Vq=+d6oy-kg+diu=irot3enOhpQNMg@mail.gmail.com>
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