Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many people were involved in a project? Based on Revision Control System

How do you know how many developers were involved in a project using a Revision Control System? A friend of mine found this way to look up the answer in git log:

git log | grep Author: | sort -u | cut –delimiter=” ” -f2 | sort -u | wc -l

Is there a straightforward way in git? How about other Revision Control System like Subversion, Bazaar or Mercurial?

like image 318
Juanjo Conti Avatar asked Nov 28 '09 20:11

Juanjo Conti


People also ask

How many versions of control system are there?

There are two types of version control: centralized and distributed.

What are the three types of version control?

The types of VCS are: Local Version Control System. Centralized Version Control System. Distributed Version Control System.

Which is an example of a version control system?

Some popular version control systems are Git (distributed), Mercurial (distributed), and Subversion (centralized). In centralized version control, each user gets his or her own working copy, but there is just one central repository.

Is version control important in a project?

Version control is important to keep track of changes — and keep every team member working on the right version. You should use version control software for all code, files, and assets that multiple team members will collaborate on.


2 Answers

git

The shortlog command is very useful. This summarizes the typical git-log output.

$ git shortlog -sn
   119  tsaleh
   113  Joe Ferris
    70  Ryan McGeary
    45  Tammer Saleh
    45  Dan Croak
    19  Matt Jankowski
    ...

Pass to wc to see the number of unique usernames:

$ git shortlog -sn | wc -l
      40
like image 136
Ryan McGeary Avatar answered Oct 16 '22 08:10

Ryan McGeary


For mercurial, there's an extension to do exactly that: hg churn.

hg churn sorts by line-changed, if you want changeset count, use hg churn -c.

like image 39
tonfa Avatar answered Oct 16 '22 09:10

tonfa