gimme-stat is a CLI GIT report tool

Having a git repository you can get the report which includes commits count per developer, number of changed lines, their percentage relative with other project developers.

It has flexible customization which allows to combine a list of repositories, merge developers nicknames, exclude some of them from the report. Allow to export the report to MD format.

Installation

Terminal
$ npm -g install gimme-stat
$ cd /home/your_git_project_name
$ gimme-stat

Available Arguments

Examples

Example 1: Detailed graph with file extensions

$ gimme-stat --since=3.months --cwd="/home/project" --graph=detailed
Output
Nicolas Cage        ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 38.34%
├── cs              ███████████████████░░░░░░░░░░░░░░░░░░░░░ 47.51%
├── other           ██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.64%
├── js              ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 16.88%
├── scss            ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.41%
├── sql             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.46%
└── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.10%
Tom Hanks           ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.91%
├── cs              ███████████████████████░░░░░░░░░░░░░░░░░ 57.25%
├── other           ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 36.08%
├── js              ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.18%
├── scss            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.64%
├── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.50%
├── html            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.18%
└── sql             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.18%
Keanu Reeves        █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 22.84%
├── cs              ██████████████████████░░░░░░░░░░░░░░░░░░ 54.38%
├── other           ██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 25.49%
├── js              ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 15.45%
├── sql             █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.40%
├── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.73%
├── scss            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.45%
└── html            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.11%
Morgan Freeman      █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.90%
├── cs              █████████████████████████████████████░░░ 92.11%
├── other           ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.14%
└── js              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.75%

Example 2: Short graph with detailed bar type

$ gimme-stat --graph=short --bartype=detailed --barsize=40
Output
    Legend:
    + - insertions
    - - deletions

Nicolas Cage   [-----------------+++++++++++            ] 71.26%
Tom Hanks      [-------++++                             ] 28.74%

Example 3: Short graph with daily statistics

$ gimme-stat --since=1.weeks --graph=short --barsize=50 --daily
Output
Nicolas Cage   ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 38.34%
Tom Hanks      ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.91%
Keanu Reeves   █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 22.84%
Morgan Freeman █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.90%

                                                      commits|changes
Thu Nov 23 2017 ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4   | 119
Fri Nov 24 2017 ████████████████░░░░░░░░░░░░░░░░░░░░░░░░ 7   | 290
Sat Nov 25 2017 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0   | 0
Sun Nov 26 2017 ██████████████████░░░░░░░░░░░░░░░░░░░░░░ 6   | 330
Mon Nov 27 2017 ████████████████████████████░░░░░░░░░░░░ 8   | 517
Tue Nov 28 2017 ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 5   | 265
Wed Nov 29 2017 ████████████████████████████████████████ 20  | 741

Example 4: Daily statistics for specific user

$ gimme-stat --since=1.weeks --daily --users="Dat Ding" --graph=none
Output
                                                      commits|changes
Thu Nov 23 2017 ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4   | 119
Fri Nov 24 2017 ████████████████░░░░░░░░░░░░░░░░░░░░░░░░ 7   | 290
Sat Nov 25 2017 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0   | 0
Sun Nov 26 2017 ██████████████████░░░░░░░░░░░░░░░░░░░░░░ 6   | 330
Mon Nov 27 2017 ████████████████████████████░░░░░░░░░░░░ 8   | 517
Tue Nov 28 2017 ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 5   | 265
Wed Nov 29 2017 ████████████████████████████████████████ 20  | 741

Example 5: Table format

$ gimme-stat --since=3.months --graph=none --table
Output
┌────────────────┬─────────┬────────────┬───────────┬──────────────┐
│ Author         │ Commits │ Insertions │ Deletions │ % of changes │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Nicolas Cage   │ 69      │ 2237       │ 1110      │ 36           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Tom Hanks      │ 92      │ 2335       │ 905       │ 35           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Keanu Reeves   │ 42      │ 1389       │ 801       │ 24           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Morgan Freeman │ 5       │ 209        │ 127       │ 4            │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Samuel Jackson │ 4       │ 193        │ 35        │ 3            │
└────────────────┴─────────┴────────────┴───────────┴──────────────┘

JSON Configuration gimme.config.js

To save your git report / gimme-stat configuration create following gimme.config.js file.

module.exports = {
    userAliases   : [
        'Barack Obama>Reptiloid',
        'Justin Bieber>Reptiloid'
    ],
    appendToMd    : "report.md",
    since         : "1.weeks",
    until         : "",
    graph         : "short",
    lmargin       : 19,
    barSize       : 100,
    cwd           : [
        "C:/repository/MyProject1",
        "C:/repository/MyProject2"
    ],
    users         :'',
    barType       :'default',
    //Masks of files which will be ignored in your statistic
    statIgnore    : [
        /node_modules/mi,
        /package\-lock\.json/mi,
        /yarn\.lock/mi,
        /assets/mi,
        /dist/mi,
        /\.gitignore/,
        /www(\/|\\)build/mi,
        /^(\/|\\)www/mi,
        /\.idea/,
        /config\.xml/,
        /\.sourcemaps/,
        /.+\.map/
    ],


    table: false,
    daily: false,
    prepull: false,
    // The file extensions will be shown in your statistic,
    // other will be under 'other' category.
    statExtensions: [
        'js', 'html', 'htm', 'cs', 'css', 'scss', 'less',
        'json', 'php', 'sql'
    ],

    //The users will be ignored in your statistics
    ignoreUsers : [
        'Unknown', 'user1'
    ]
}

Report types

Repositories

Repositories
Repositories:
home/rep/project1
home/rep/project2

Short

Short Statistics
Nicolas Cage   ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 38.34%
Tom Hanks      ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.91%
Keanu Reeves   █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 22.84%
Morgan Freeman █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.90%

Detailed

Detailed Statistics
Nicolas Cage        ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░ 38.34%
├── cs              ███████████████████░░░░░░░░░░░░░░░░░░░░░ 47.51%
├── other           ██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 26.64%
├── js              ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 16.88%
├── scss            ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.41%
├── sql             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.46%
└── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.10%
Tom Hanks           ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.91%
├── cs              ███████████████████████░░░░░░░░░░░░░░░░░ 57.25%
├── other           ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 36.08%
├── js              ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.18%
├── scss            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.64%
├── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.50%
├── html            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.18%
└── sql             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.18%
Keanu Reeves        █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 22.84%
├── cs              ██████████████████████░░░░░░░░░░░░░░░░░░ 54.38%
├── other           ██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 25.49%
├── js              ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 15.45%
├── sql             █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.40%
├── json            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.73%
├── scss            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.45%
└── html            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.11%
Morgan Freeman      █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.90%
├── cs              █████████████████████████████████████░░░ 92.11%
├── other           ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.14%
└── js              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.75%

Table

Table Statistics
┌────────────────┬─────────┬────────────┬───────────┬──────────────┐
│ Author         │ Commits │ Insertions │ Deletions │ % of changes │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Nicolas Cage   │ 69      │ 2237       │ 1110      │ 36           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Tom Hanks      │ 92      │ 2335       │ 905       │ 35           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Keanu Reeves   │ 42      │ 1389       │ 801       │ 24           │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Morgan Freeman │ 5       │ 209        │ 127       │ 4            │
├────────────────┼─────────┼────────────┼───────────┼──────────────┤
│ Samuel Jackson │ 4       │ 193        │ 35        │ 3            │
└────────────────┴─────────┴────────────┴───────────┴──────────────┘

Daily

Daily Statistics
                                                      commits|changes
Thu Nov 23 2017 ██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4   | 119
Fri Nov 24 2017 ████████████████░░░░░░░░░░░░░░░░░░░░░░░░ 7   | 290
Sat Nov 25 2017 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0   | 0
Sun Nov 26 2017 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0   | 0
Mon Nov 27 2017 ██████████████████░░░░░░░░░░░░░░░░░░░░░░ 6   | 330
Tue Nov 28 2017 ████████████████████████████░░░░░░░░░░░░ 8   | 517
Wed Nov 29 2017 ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 5   | 265
Thu Nov 30 2017 ████████████████████████████████████████ 20  | 741

Usage as Node.js Module

Easiest way to use it is to call module with default parameters, use empty object for this.

let gimmeStat = require('gimme-stat');
gimmeStat.text({}).then((answer) => {
    console.log(answer);
});

Available 3 type of return:

Also you can choose parameters, pass it as an object

let gimmeStat = require('gimme-stat');
gimmeStat.text({
    appendToMd:false,
    barSize:60,
    barType:"default",
    cwd:Array(1) ["."],
    daily:false,
    graph:"short",
    ignoreUsers:Array(2) ["Unknown", "user1"],
    init:false,
    prepull:false,
    since:"3.months",
    table:false,
    until:"",
    userAliases:Object {'Barack Obama': "Reptiloid", 'Justin Bieber': "Reptiloid"},
    users:Array(1) [""]
}).then((answer) => {console.log(answer);});