mnapoli/gitstats 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mnapoli/gitstats

Composer 安装命令:

composer require mnapoli/gitstats

包简介

Iterate through git commits to gather statistics

README 文档

README

Installation

  • clone this repository
  • install Composer dependencies
  • symlink the gitstats to your /usr/local/bin: ln -s /home/<you>/code/gitstats/gitstats /usr/local/bin/gitstats

Alternatively you can install the Composer package globally (composer global require mnapoli/gitstats)

Usage

  • Add a .gitstats.yml file in your current directory:
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 | xargs"
    'Number of directories': "find . -type d | wc -l | xargs"
  • Run the application:
$ gitstats run <git-repository-url>

The repository will be cloned in a temporary directory. All tasks will be run against each commit. Ensure the repository doesn't contain modifications.

The output is formatted as CSV:

Commit,Date,Number of files,Number of directories
d612a29fae3b0f625b9be819802e93214d4eecd9,2016-08-31T12:55:38+02:00,61,28
497f22a27896d146a35660f452eba24d3a14db3f,2016-08-31T12:53:01+02:00,61,28
fc0646f236e6bb0a10b14a67424f932f28eb1062,2016-08-26T19:29:40+02:00,62,28
221528e63d7aac3aa247dfde191b5f6c380cbb7e,2016-08-25T01:28:55+02:00,62,28
...

You can write the output to a file:

$ gitstats run <git-repository-url> > results.csv

You can then import that into a database or open it up with Excel or whatever.

MySQL

You can output the result as SQL queries to insert/update a MySQL table:

$ gitstats run <git-repository-url> --format=sql | mysql -u <user> -p <table>

Limit the number of commits processed

You can limit the number of commits to process using the --max parameter:

# Process only 100 commits
$ gitstats run <git-repository-url> --max=100

Show the progress

You can show a progress bar on stderr using the --progress parameter. When using that parameter it makes sense to redirect the output to a file or another command:

$ gitstats run <git-repository-url> --progress > file.csv

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固