定制 bdelespierre/gitstats 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bdelespierre/gitstats

Composer 安装命令:

composer require bdelespierre/gitstats

包简介

Iterate through git commits to gather statistics

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Rewinds your Git history to compute stats.

Installation

composer global require bdelespierre/gitstats
Add composer global vendor/bin directory to your PATH

Best way to do it is to add these lines to your ~/.profile:

# Composer 1 global vendor/bin to PATH
if [ -d "$HOME/.composer/vendor/bin" ] ; then
    PATH="$PATH:$HOME/.composer/vendor/bin"
fi

# Composer 2 global vendor/bin to PATH
if [ -d "$HOME/.config/composer/vendor/bin" ] ; then
    PATH="$PATH:$HOME/.config/composer/vendor/bin"
fi

export PATH

Usage

Add a .gitstats.php file in your project root directory:

<?php

return [
    'tasks' => [
        'Commit message' => "git log -1 --pretty=%B | head -n 1",
        'Commit author' => "git log -1 --pretty=%an",
        'Number of files' => "find . -type f | wc -l",
        'Number of directories' => "find . -type d | wc -l",
    ],
];

Run the application:

gitstats run

The output is formatted as CSV:

commit,date,"Commit message","Commit author","Number of files","Number of directories"
0e75bcac756226986f9e6ba745c0f1944ee482db,"2021-04-01 12:40:04","Major refactoring","Benjamin Delespierre",1647,398
1cd263613b1b3bb96bff86a04c0e0c42c9427f32,"2018-01-14 11:15:16","Add progress screenshot","Matthieu Napoli",1649,396
3159438bd963174acac8518d9d58e85fc5fb431f,"2018-01-10 11:48:56","Restrict dependencies correctly","Matthieu Napoli",1649,396
2dd0cf355552553eebc3614ada24c305393c628c,"2018-01-10 11:48:09","Show a progress bar","Matthieu Napoli",1649,396
a731d6c9d91c8e4f07db0bec6e22c912a55baef2,"2017-10-22 18:02:03","MIT License","Matthieu Napoli",1649,396
...

You can write the output to a file:

gitstats run > gistats.csv

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固