【问题标题】:How to list commiters sorted by number of commits (commit count)?如何列出按提交次数(提交计数)排序的委员会?
【发布时间】:2011-05-25 15:10:00
【问题描述】:

在 mercurial 中,如何按提交次数(提交计数)列出提交者。

使用 git,你可以做这样的事情:

git shortlog -ns

mercurial 的等效命令是什么?

【问题讨论】:

    标签: mercurial


    【解决方案1】:

    没有纯 Mercurial 解决方案,但您可以执行以下操作:

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

    如果您希望能够输入hg shortlog,可以将以下内容添加到您的.hgrcmercurial.ini

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

    【讨论】:

      【解决方案2】:

      churn extension 可以为您绘制包含信息的漂亮直方图。添加

      [extensions]
      churn =
      

      到您的 Mercurial 配置文件并运行

      $ hg churn -c
      

      得到这样的直方图:

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

      该直方图来自 Mercurial 存储库本身。

      【讨论】:

      【解决方案3】:

      我创建了一个script for Roundup,以根据 Mercurial 历史按年建立项目贡献者列表。它是跨平台的公共领域,应该很容易根据您自己的目的进行定制。

      【讨论】:

        猜你喜欢
        • 2021-08-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-12-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多