Identify the most relevant git contributors based on commit recency, frequency, and impact

栏目: IT技术 · 发布时间: 6年前

内容简介:The net effect

gitpert

gitpert measures the "pertinence" of git authors as a time-decayed measure of LOC added and removed to a repository (or a set of files in a repository). It's meant to help identify who the most relevant contributors are based on commit recency, frequency and impact.

  • impact in this context is lines of code added plus lines of code removed by a commit. Vendored dependency files are ignored (as best as possible).
  • decay rate determines how long it takes for the impact of a commit to halve, based on how recently the commit was made. If the decay rate is 10 days, a commit that added 100 lines of code, authored 10 days ago, will be scored at 50. It is a half-life, and can be supplied as a config parameter.
  • score is the sum of the time decayed impact of every commit in a repository, for a given author.

The net effect should be a ranked list of authors (contributors) where those who have more recently and more frequently contributed "larger" commits surface to the top. An author who committed the initial code many years ago (maybe higher impact) will likely rank lower than an author who has contributed less impactfully, but much more recently (depending on the decay rate and absolute numbers, of course).

This could be useful for identifying who the best person to review a new code change might be, or who the best person to ask questions or seek help from might be. Scoring can be done at the repository level, and also for individual files (the most pertinent author for a repository might not be the most pertinent for a directory or file within that repository).

Installation

Homebrew

brew tap augmentable-dev/gitpert
brew install gitpert

Usage

Running

gitpert

in a git repository will output a ranking table like so:

Rank   Email                                      Name                      Score   Impact   Commits
1      user1@users.noreply.github.com             User One                  191     6064     92
2      user2@gmail.com                            User Two                  171     931      27
3      user3@gmail.com                            User Three                40      4366     38
...

use the -d flag to set the decay rate (in days) gitpert -d 90 will output a ranking table where score is based on impact that halves at commits made 90 days ago.

gitpert -h

will have more specific and up to date usage info.

FAQ

What about git-blame?

git-blame will tell you about the last modification to lines in a file (the author and revision), and is certainly useful. This tool hopes to provide a higher level view of the net effect of authorship in a repository as a function of time.

Why are changes to "vendored" dependencies ignored?

Authoring a large commit because it adds or removes many dependencies (think the vendor/ directory in golang projects), while in most contexts an important contribution, gives an outsized "impact" to that commit which probably shouldn't be evaluated in the same way as "typical" LOC.

Should LOC added be weighed the same as LOC removed?

Maybe. This could be worth exposing as a config parameter. One could argue that a LOC added should weigh some amount more than a LOC removed.

How are commits aggregated to an author?

By email address. Authors using multiple email addresses (say, because of GitHub's ...@users.noreply.github.com ) will be tracked as distinct authors. An option to enumerate which emails should be treated as belonging to the same author should be implemented.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

编程珠玑(第二版)

编程珠玑(第二版)

[美] Jon Bentley / 谢君英、石朝江 / 中国电力出版社 / 2004-4 / 28.00元

《编程珠玑(第2版)》是计算机科学方面的经典名著。书的内容围绕程序设计人员面对的一系列实际问题展开。作者Jon Bentley 以其独有的洞察力和创造力,引导读者理解这些问题并学会解决方法,而这些正是程序员实际编程生涯中至关重要的。一起来看看 《编程珠玑(第二版)》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具