如何根据d计算git库的SLOC

2024-06-16 10:56:14 发布

您现在位置:Python中文网/ 问答频道 /正文

例如,用给定的日期(2年前或其他时间)计算git的SLOC。在

我还有一个问题: 如何找出修改最多的前10个程序文件和前5个组件 在给定日期的git库中(更改代码行总数最多或修改次数最多)?在


Tags: 文件代码git程序时间组件次数给定日期
1条回答
网友
1楼 · 发布于 2024-06-16 10:56:14

您可以调整这个ruby script,它调用git diff stat来获得这些统计信息。在

对于python,有“^{}

2010-05-13 14:38:21       42   +44    -2     initial
2010-05-13 14:40:14       44    +3    -1     hashbang added
2010-05-13 14:40:14       49    +8    -3     show last commit too

Run it as `git-loc svg' to output svg graph on stdout.

查看^{} SPECIFYING REVISIONS查看如何使用日期:

<refname>@{<date>}, e.g. master@{yesterday}, HEAD@{5 minutes ago}

A ref followed by the suffix @ with a date specification enclosed in a brace pair (e.g. {yesterday}, {1 month 2 weeks 3 days 1 hour 1 second ago} or {1979-02-26 18:30:00}) specifies the value of the ref at a prior point in time.

您可以将这些git diffgit log命令与“Finding most changed files in git”结合使用:

^{pr2}$

相关问题 更多 >