一个项目有多少人参与?基于修订控制系统

发布于 2024-08-13 14:31:38 字数 250 浏览 4 评论 0原文

您如何知道有多少开发人员参与了使用修订控制系统的项目?我的一个朋友在 git log 中查找答案时发现了这种方法:

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

Is there a simple way in git?其他版本控制系统(如 Subversion、Bazaar 或 Mercurial)怎么样?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

手心的温暖 2024-08-20 14:31:39

Bazaar 有一个统计插件,可以获取有关项目贡献者的不同信息:

https://launchpad.net/bzr-stats /

There is stats plugin for Bazaar to get different info about project contributors:

https://launchpad.net/bzr-stats/

天赋异禀 2024-08-20 14:31:39

我也不知道 Mercurial 有什么直接的方法,并且对其所有文档进行了很好的搜索也没有透露任何信息。所以,这里有一个 *nix 命令,类似于你的朋友在 Mercurial 中找到的命令:

hg log | grep user: | cut -c 14- | sort -u | uniq | wc -l

顺便说一句,我认为 git 命令有一个错误,第二个 sort -u 肯定应该替换为 uniq !

I'm not aware of a straightforward way for Mercurial either and a good search of all its documentation didn't revealed anything too. So, here's a *nix command, similar to the one your friend found, for Mercurial:

hg log | grep user: | cut -c 14- | sort -u | uniq | wc -l

BTW, I think there's an error with the command for git, the second sort -u should surely be replaced by uniq!

装纯掩盖桑 2024-08-20 14:31:39

Mercurial 内置了强大的模板语言(请参阅hg 帮助模板)。因此,您可以获取项目中所有人员的列表,而无需启用流失扩展:

hg log --template '{author}\n' | sort -u

如果人们更改了电子邮件地址(但姓名保持不变),那么您可以处理 author 模板关键字一点:

hg log --template '{author|person}\n' | sort -u

然后根据上述命令添加 wc -l

Mercurial has a powerful template language built-in (see hg help templates). So you can get a list of all people in the project without enabling the churn extension:

hg log --template '{author}\n' | sort -u

If people have changed their email address (but otherwise kept their name the same), then you can process the author template keyword a bit:

hg log --template '{author|person}\n' | sort -u

Then add wc -l as appropriate to the above commands.

一个更简单的 git 版本是:

git log --pretty=tformat:%an | sort -u | wc -l

或者如果您关心唯一的电子邮件地址:

git log --pretty=tformat:%ae | sort -u | wc -l

A simpler git version is:

git log --pretty=tformat:%an | sort -u | wc -l

or if you care about unique email addresses:

git log --pretty=tformat:%ae | sort -u | wc -l
若沐 2024-08-20 14:31:38

git

shortlog 命令非常有用。这总结了典型的 git-log 输出。

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

传递到 wc 以查看唯一用户名的数量:

$ git shortlog -sn | wc -l
      40

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
甜尕妞 2024-08-20 14:31:38

对于 Mercurial,有一个扩展可以做到这一点:hg churn

hg churn 按行更改排序,如果您想要更改集计数,请使用 hg churn -c

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.

樱&纷飞 2024-08-20 14:31:38

为了颠覆

svn log -q svn://path/to/repo | cut -f 3 -d " "  | sort -u

For subversion

svn log -q svn://path/to/repo | cut -f 3 -d " "  | sort -u
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文