开发者

How to list commiters sorted by number of commits (commit count)?

In mercurial, how do you list commiters sorted by number of commits (commit count).

Using g开发者_开发知识库it, you can do something like this :

git shortlog -ns

What is the equivalent command for mercurial ?


There is no pure Mercurial solution, but you can do something like:

hg log --template "{author|person}\n" | sort | uniq -c | sort -nr

If you want to be able to type hg shortlog, you can add the following to your .hgrc or mercurial.ini:

[alias]
shortlog = !hg log --template "{author|person}\n" | sort | uniq -c | sort -nr


The churn extension can draw you a nice histogram with the information. Add

[extensions]
churn =

to your Mercurial configuration file and run

$ hg churn -c

to get a histogram like this:

mpm@selenic.com                           3234 *************************    
thomas@intevation.de                       974 ********
pmezard@gmail.com                          939 *******

That historgram is from the Mercurial repository itself.


I've made a script for Roundup to build list of project contributors by years based on Mercurial history. It is cross-platform, public domain and should be easy to customize for your own purpose.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜