git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Hongyi ZhaoNext: Hongyi Zhao
Message 4 of 7 in “Method for Calculating Statistics of Developer Contribution to a Specified Branch.”
  1. Hongyi ZhaoOct 16, 2023
  2. brian m. carlsonOct 16, 2023
  3. Hongyi ZhaoOct 17, 2023
  4. Taylor BlauOct 30, 2023
  5. Hongyi ZhaoOct 31, 2023
  6. Junio C HamanoOct 31, 2023
  7. Taylor BlauOct 31, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.