Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Mercurial, how can I measure individual contributions?

My team is using Mercurial, and I would like to know the relative contributions by each team member. I know that we cannot measure productivity by lines of code, but I would like to see if each person at least contributed something, even if it was overwritten by others later. So, I don't just want to see who is responsible for the current version (a la Mercurial annotate), but to do this recursively through all revisions, ideally with output that can be easily visualized or dumped into a spreadsheet.

Any tips?

like image 812
Paul Avatar asked Dec 11 '10 16:12

Paul


2 Answers

There's an extension exactly for this, named churn, it is bundled with Mercurial, but not automatically enabled. You can find more information here: ChurnExtension.

In your mercurial.ini file, to the [extensions] section, add the following:

[extensions]
churn=

Then to look at the churn of your repository, just do:

hg churn

This will output something like this (this is for the Noda-Time project):

[C:\Dev\VS.NET\Noda-Time-docs] :hg churn
[email protected]              296444 *************************************************************************************************************
[email protected]       203877 ***************************************************************************
James Keesey                  80466 ******************************
[email protected]      25552 *********
Dmitry Bullavin               17657 ******
[email protected]  16325 ******
Dmitry Bulavin                 4273 **
james.keesey                   2650 *
matt.scharley                   768
configurator                    450
[email protected]                64
TeamCity@Nordrassil               2
like image 166
Lasse V. Karlsen Avatar answered Nov 07 '22 20:11

Lasse V. Karlsen


Churn does the job, but note that it if a user moves files a lot, he will have huge amounts of changed lines. I just did a test, here are the results:

C:\Projects\personal\test>hg churn
[email protected]     10 *****************************************

C:\Projects\personal\test>hg mv a.a b.b
moving a.a to b.b

C:\Projects\personal\test>hg commit -m "moving 10 lines to another location"
b.b
committed changeset 1:c54200557152

C:\Projects\personal\test>hg churn
[email protected]     30 *****************************************

Note that I have only created 10 lines, but for moving a file I got 20 line changes. That does not convey a good picture.

like image 35
Darius Avatar answered Nov 07 '22 20:11

Darius