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
HZHongyi Zhao <hongyi.zhao@gmail.com>
Date
Oct 31, 2023, 05:09 UTC
Message-ID
<CAGP6POK2yABRhJHQYfOFZ2h6BSy9XU6aZbnBaA11TJiEnBAa6g@mail.gmail.com>
In-Reply-To
<ZUAk6dPJyhfb7UBM@nand.local>
On Tue, Oct 31, 2023 at 5:49 AM Taylor Blau <me@ttaylorr.com> wrote:
Show 14 quoted lines
>
> 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 }'
See below:

werner@X10DAi:~/Public/repo/github.com/OrderN/CONQUEST-release.git$ git log --author="JianboLin" --stat --summary origin/f-mlff | awk 'NF ==4 && $2 =="|" && $3 ~/[0-9]+/ && $4 ~/[+-]+|[+]+|[-]+/ {s+=$3} END {print s}' 8519 werner@X10DAi:~/Public/repo/github.com/OrderN/CONQUEST-release.git$ git rev-list --author="JianboLin" origin/f-mlff | git diff-tree --stdin -r --numstat --no-commit-id | awk '{ s += $1 + $2 } END { print s }' 8519

So, your method and my original one give exactly the same result. Therefore, I can't see what their fundamental difference is.

> Thanks,
> Taylor

Regards, Zhao

Previous: Taylor BlauNext: Junio C Hamano
Message 5 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.