{"thread":{"id":"60373","subject":"Method for Calculating Statistics of Developer Contribution to a Specified Branch.","startedAt":"2023-10-16T14:10:15Z","lastAt":"2023-10-31T19:05:29Z","messageCount":7,"participants":["Hongyi Zhao","brian m. carlson","Taylor Blau","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483307","messageId":"CAGP6POKg4mSFv-Z+dD1aXDFDbxH9Xu1WCdCA5TGfCAM3NUUQLw@mail.gmail.com","threadId":"60373","inReplyTo":null,"subject":"Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2023-10-16T14:10:01Z","receivedAt":"2023-10-16T14:10:15Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"Dear Git Mailing List,\n\nI am a developer currently working on a project and I wanted to\nestablish statistics for each team member's contribution to a specific\nbranch.\n\nSay, for a user \"JianboLin\", I am currently using the following method:\n\n$ git clone https://github.com/OrderN/CONQUEST-release.git\n$ cd CONQUEST-release\n$ git log --author=\"JianboLin\" --stat --summary origin/f-mlff | awk\n'NF ==4 && $2 ==\"|\" && $3 ~/[0-9]+/ && $4 ~/[+-]+|[+]+|[-]+/ {s+=$3}\nEND {print s}'\n\nUsing the above command, I am able to calculate the number of lines\ncontributed by a specific author on a specific branch, which allows me\nto quantify the contribution to a branch by each team member.\n\nHowever, I would like to know if a more efficient or accurate method\nexists to carry out this task. Are there any other parameters,\ncommands, or aspects I need to consider to get a more comprehensive\nmeasure of contribution?\n\nI greatly appreciate your expertise and look forward to your valuable input.\n\nBest Regards,\n\nZhao\n-- \nAssoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>\nTheory and Simulation of Materials\nHebei Vocational University of Technology and Engineering\nNo. 473, Quannan West Street, Xindu District, Xingtai, Hebei province\n"},{"id":"483318","messageId":"ZS2qZtYDvItovjqg@tapette.crustytoothpaste.net","threadId":"60373","inReplyTo":"CAGP6POKg4mSFv-Z+dD1aXDFDbxH9Xu1WCdCA5TGfCAM3NUUQLw@mail.gmail.com","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2023-10-16T21:25:58Z","receivedAt":"2023-10-16T21:26:05Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2023-10-16 at 14:10:01, Hongyi Zhao wrote:\n> Dear Git Mailing List,\n> \n> I am a developer currently working on a project and I wanted to\n> establish statistics for each team member's contribution to a specific\n> branch.\n> \n> Say, for a user \"JianboLin\", I am currently using the following method:\n> \n> $ git clone https://github.com/OrderN/CONQUEST-release.git\n> $ cd CONQUEST-release\n> $ git log --author=\"JianboLin\" --stat --summary origin/f-mlff | awk\n> 'NF ==4 && $2 ==\"|\" && $3 ~/[0-9]+/ && $4 ~/[+-]+|[+]+|[-]+/ {s+=$3}\n> END {print s}'\n> \n> Using the above command, I am able to calculate the number of lines\n> contributed by a specific author on a specific branch, which allows me\n> to quantify the contribution to a branch by each team member.\n> \n> However, I would like to know if a more efficient or accurate method\n> exists to carry out this task. Are there any other parameters,\n> commands, or aspects I need to consider to get a more comprehensive\n> measure of contribution?\n\nCan you maybe explain what you want to measure and what your goal is in\ndoing so?\n\nThe problem is that lines of code isn't really that useful as a measure\nof contribution value or developer productivity, which are the reasons\npeople typically measure that metric.  For example, with three lines, a\ncolleague fixed a persistently difficult-to-reproduce problem which had\nbeen affecting many of our largest customers.  That was a very valuable\ncontribution, but not very large.  I've made similar kinds of changes\nmyself, both at work and in open source projects.\n\nCertainly you can compute the number of lines of code changed by a\ndeveloper, but that is not typically a very useful metric, since it\ndoesn't lead you to any interesting conclusions about the benefits or\nvalue of the contributions or developer in question.  However, perhaps\nyou have a different goal in mind, and if you can explain what that is,\nwe may be able to help you find a better way of doing it.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"483340","messageId":"CAGP6PO+SeZPzD21nErX=Vq=+d6oy-kg+diu=irot3enOhpQNMg@mail.gmail.com","threadId":"60373","inReplyTo":"ZS2qZtYDvItovjqg@tapette.crustytoothpaste.net","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2023-10-17T11:37:46Z","receivedAt":"2023-10-17T11:37:59Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"On Tue, Oct 17, 2023 at 5:26 AM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2023-10-16 at 14:10:01, Hongyi Zhao wrote:\n> > Dear Git Mailing List,\n> >\n> > I am a developer currently working on a project and I wanted to\n> > establish statistics for each team member's contribution to a specific\n> > branch.\n> >\n> > Say, for a user \"JianboLin\", I am currently using the following method:\n> >\n> > $ git clone https://github.com/OrderN/CONQUEST-release.git\n> > $ cd CONQUEST-release\n> > $ git log --author=\"JianboLin\" --stat --summary origin/f-mlff | awk\n> > 'NF ==4 && $2 ==\"|\" && $3 ~/[0-9]+/ && $4 ~/[+-]+|[+]+|[-]+/ {s+=$3}\n> > END {print s}'\n> >\n> > Using the above command, I am able to calculate the number of lines\n> > contributed by a specific author on a specific branch, which allows me\n> > to quantify the contribution to a branch by each team member.\n> >\n> > However, I would like to know if a more efficient or accurate method\n> > exists to carry out this task. Are there any other parameters,\n> > commands, or aspects I need to consider to get a more comprehensive\n> > measure of contribution?\n>\n> Can you maybe explain what you want to measure and what your goal is in\n> doing so?\n>\n> The problem is that lines of code isn't really that useful as a measure\n> of contribution value or developer productivity, which are the reasons\n> people typically measure that metric.  For example, with three lines, a\n> colleague fixed a persistently difficult-to-reproduce problem which had\n> been affecting many of our largest customers.  That was a very valuable\n> contribution, but not very large.  I've made similar kinds of changes\n> myself, both at work and in open source projects.\n>\n> Certainly you can compute the number of lines of code changed by a\n> developer, but that is not typically a very useful metric, since it\n> doesn't lead you to any interesting conclusions about the benefits or\n> value of the contributions or developer in question.  However, perhaps\n> you have a different goal in mind, and if you can explain what that is,\n> we may be able to help you find a better way of doing it.\n\nI want to calculate a certain developer's contribution based on\ndifferent standards of code line count and the importance of the code.\n\n> --\n> brian m. carlson (he/him or they/them)\n> Toronto, Ontario, CA\n\nRegards,\nZhao\n"},{"id":"484155","messageId":"ZUAk6dPJyhfb7UBM@nand.local","threadId":"60373","inReplyTo":"CAGP6PO+SeZPzD21nErX=Vq=+d6oy-kg+diu=irot3enOhpQNMg@mail.gmail.com","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2023-10-30T21:49:29Z","receivedAt":"2023-10-30T21:49:32Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Oct 17, 2023 at 07:37:46PM +0800, Hongyi Zhao wrote:\n> I want to calculate a certain developer's contribution based on\n> different standards of code line count and the importance of the code.\n\nI agree with brian that \"number of lines added/removed\" is not a perfect\nmeasure of productivity ;-).\n\nBut I think that there is a slightly cleaner way to compute the result\nyou're after, like so:\n\n    git rev-list --author=\"$who\" origin/main |\n    git diff-tree --stdin -r --numstat --no-commit-id |\n    awk '{ s += $1 + $2 } END { print s }'\n\nThanks,\nTaylor\n"},{"id":"484185","messageId":"CAGP6POK2yABRhJHQYfOFZ2h6BSy9XU6aZbnBaA11TJiEnBAa6g@mail.gmail.com","threadId":"60373","inReplyTo":"ZUAk6dPJyhfb7UBM@nand.local","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2023-10-31T05:09:55Z","receivedAt":"2023-10-31T05:10:09Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"On Tue, Oct 31, 2023 at 5:49 AM Taylor Blau <me@ttaylorr.com> wrote:\n>\n> On Tue, Oct 17, 2023 at 07:37:46PM +0800, Hongyi Zhao wrote:\n> > I want to calculate a certain developer's contribution based on\n> > different standards of code line count and the importance of the code.\n>\n> I agree with brian that \"number of lines added/removed\" is not a perfect\n> measure of productivity ;-).\n>\n> But I think that there is a slightly cleaner way to compute the result\n> you're after, like so:\n>\n>     git rev-list --author=\"$who\" origin/main |\n>     git diff-tree --stdin -r --numstat --no-commit-id |\n>     awk '{ s += $1 + $2 } END { print s }'\n\nSee below:\n\nwerner@X10DAi:~/Public/repo/github.com/OrderN/CONQUEST-release.git$\ngit log --author=\"JianboLin\" --stat --summary origin/f-mlff | awk 'NF\n==4 && $2 ==\"|\" && $3 ~/[0-9]+/ && $4 ~/[+-]+|[+]+|[-]+/ {s+=$3} END\n{print s}'\n8519\nwerner@X10DAi:~/Public/repo/github.com/OrderN/CONQUEST-release.git$\ngit rev-list --author=\"JianboLin\" origin/f-mlff |     git diff-tree\n--stdin -r --numstat --no-commit-id |     awk '{ s += $1 + $2 } END {\nprint s }'\n8519\n\nSo, your method and my original one give exactly the same result.\nTherefore, I can't see what their fundamental difference is.\n\n> Thanks,\n> Taylor\n\nRegards,\nZhao\n"},{"id":"484199","messageId":"xmqqsf5r2tr3.fsf@gitster.g","threadId":"60373","inReplyTo":"CAGP6POK2yABRhJHQYfOFZ2h6BSy9XU6aZbnBaA11TJiEnBAa6g@mail.gmail.com","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-31T06:25:36Z","receivedAt":"2023-10-31T06:25:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hongyi Zhao <hongyi.zhao@gmail.com> writes:\n\n>> But I think that there is a slightly cleaner way to compute the result\n>> you're after, like so:\n>> ...\n> So, your method and my original one give exactly the same result.\n> Therefore, I can't see what their fundamental difference is.\n\nI think Taylor offered a \"slightly cleaner way\", and not a\n\"different way that computes better result\".  So it is not\nsurprising, at least to me who is watching from the sideline, that\nyou cannot see any fundamental difference.\n"},{"id":"484243","messageId":"ZUFP9bQe5FL8QYDn@nand.local","threadId":"60373","inReplyTo":"xmqqsf5r2tr3.fsf@gitster.g","subject":"Re: Method for Calculating Statistics of Developer Contribution to a Specified Branch.","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2023-10-31T19:05:25Z","receivedAt":"2023-10-31T19:05:29Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Oct 31, 2023 at 03:25:36PM +0900, Junio C Hamano wrote:\n> Hongyi Zhao <hongyi.zhao@gmail.com> writes:\n>\n> >> But I think that there is a slightly cleaner way to compute the result\n> >> you're after, like so:\n> >> ...\n> > So, your method and my original one give exactly the same result.\n> > Therefore, I can't see what their fundamental difference is.\n>\n> I think Taylor offered a \"slightly cleaner way\", and not a\n> \"different way that computes better result\".  So it is not\n> surprising, at least to me who is watching from the sideline, that\n> you cannot see any fundamental difference.\n\nIndeed.\n\nThanks,\nTaylor\n"}]}