代码拉取完成,页面将自动刷新
本项目演示如何通过脚本批量分析多个Git代码仓库,按提交人归类,获取代码行数变更数量。
更多详细介绍,请见博客文章一个统计Git代码仓库签入代码行数的批量统计脚本
整个工程结构如下,
+ simpleCmd.sh 针对单个代码仓库的代码行数统计
+ analyzeGitRepo.sh 批量分析脚本
+ repoList.txt 代码仓库列表
下载代码后,直接运行如下命令,
sh ./analyzeGitRepo.sh "2020-01-01" "2021-07-20"
analyzeGitRepo将按行读取代码仓库,并进行统计分析,最后输出代码行数变更数量(按提交人)。
一个输出结果如下,
% sh ./analyzeGitRepo.sh "2020-01-01" "2021-07-20"
the period of analysis: sinceDate = 2020-01-01, untilDate = 2021-07-20
start to clone the repository: git@gitee.com:pphh/simple-demo.git, branch = master, folder = ./1-repo-master
Cloning into './1-repo-master'...
remote: Enumerating objects: 1182, done.
remote: Counting objects: 100% (279/279), done.
remote: Compressing objects: 100% (195/195), done.
remote: Total 1182 (delta 66), reused 0 (delta 0), pack-reused 903
Receiving objects: 100% (1182/1182), 306.24 KiB | 1.76 MiB/s, done.
Resolving deltas: 100% (267/267), done.
clone is completed!
try to investigate the submission status of the repository: git@gitee.com:pphh/simple-demo.git, branch = master
start to clone the repository: git@gitee.com:pphh/blog.git, branch = master, folder = ./2-repo-master
Cloning into './2-repo-master'...
remote: Enumerating objects: 357, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 357 (delta 2), reused 0 (delta 0), pack-reused 351
Receiving objects: 100% (357/357), 2.16 MiB | 1.82 MiB/s, done.
Resolving deltas: 100% (88/88), done.
clone is completed!
try to investigate the submission status of the repository: git@gitee.com:pphh/blog.git, branch = master
name new-code-lines delete-code-lines all
peipeihh 1586 0 1586
huangyh 0 0 0
分析的报告同时也输出到了目录下的finalReport.txt文件。
每列的数字意义如下,
邮箱地址:peipeihh@qq.com,欢迎来信联系。
更多的信息,可以访问博客地址:hyhblog.cn。
Apache License 2.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。