Giter VIP home page Giter VIP logo

gitstats's Introduction

GitStats

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.

gitstats's People

Contributors

bdelespierre avatar mnapoli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.