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

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

内容简介: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.


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

查看所有标签

猜你喜欢:

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

Java in a Nutshell, 6th Edition

Java in a Nutshell, 6th Edition

Benjamin J Evans、David Flanagan / O'Reilly Media / 2014-10 / USD 59.99

The latest edition of Java in a Nutshell is designed to help experienced Java programmers get the most out of Java 7 and 8, but it's also a learning path for new developers. Chock full of examples tha......一起来看看 《Java in a Nutshell, 6th Edition》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具