【问题标题】:How to generate reports about user contributions?如何生成有关用户贡献的报告?
【发布时间】:2013-09-04 18:59:23
【问题描述】:

我想知道如何创建报告。

我需要的第一个报告是从特定用户从开始到结束日期时间更改的所有文件。

第二个,类似于第一个,但我需要提交所有消息,并且文件从特定用户从开始到结束日期时间更改。

我该怎么做?

例子:

报告 1

用户

文件从 2013-07-03 12:34:45 更改为 2013-09-16 15:00:37

a.php
b.txt
c.ini
d.rb
... and the other ones

报告 2

用户

提交从 2013-07-03 12:34:452013-09-16 15:00:37 并且文件已更改

Message commit 1
    e.php
    j.txt

Message commit 2
    ka.rb
    asdf.jsp

... the another ones

【问题讨论】:

    标签: git github report reporting


    【解决方案1】:

    这是:

    我在git repo for git itself 上测试了这些:

    • Report1 将使用git diff

      C:\Users\VonC\prog\git\git>
      git diff --author="Junio C Hamano" --name-status --pretty=oneline --abbrev-commit master@{"29 Jun 2013"}..master@{"14 Aug 2013"}
      

    这并不令人满意,因为它使用的 rev-parse syntax 只能追溯到 90 天。

    更可靠的方法是让 git rev-listgit diff 获取正确的 SHA1 以供使用:
    (但这仅适用于类 unix 的 bash,不适用于 DOS shell)

        VonC@VonCvb /c/Users/VonC/prog/git/git (master)
        $ git diff --author="Junio C Hamano" --name-status --pretty=oneline --abbrev-commit $(git rev-list -n 1 --before="10 Sep 2012" master) $(git rev-list -n 1 --before="12 Nov 2012" master)
    
    • Report2 将使用git log

      C:\Users\VonC\prog\git\git>
      git log --author="Junio C Hamano" --name-status --pretty=oneline --abbrev-commit --since "10 Sep 2012" --until "12 Nov 2012"
      

    【讨论】:

    • 非常感谢。非常有趣的解决方案。我会测试然后接受答案。再次感谢您 =)
    • 精彩的脚本 VonC。再次感谢您^^
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多