Git project stat
A tool for git projects statistics generation per every user.
What does the result look like?
I've used rship repo for this example.
pkondratenko:~/projects/experimental/git-stat-project > yarn start -- --folder ~/projects/tmp/rship --after 01.01.2017 --before 31.12.2017yarn start v0.18.1$ node ./script.js --folder /Users/pkondratenko/projects/tmp/rship --after 01.01.2017 --before 31.12.2017 Commits pushed report User name Total value ratio Count m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 16 abietis@gmail.com |█████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3 me@mrsum.ru |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 a-ignatov-parc@users.noreply.github.com |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1 mrsum@mrsum.local |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1 Lines affected report User name Total value ratio Count m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 691 abietis@gmail.com |█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 63 me@mrsum.ru |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 20 mrsum@mrsum.local |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4 a-ignatov-parc@users.noreply.github.com |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0 Lines diff report User name Total value ratio Count a-ignatov-parc@users.noreply.github.com ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 me@mrsum.ru ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 mrsum@mrsum.local ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 m.chernobrov@rambler-co.ru ░░░░█████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░ -33 abietis@gmail.com █████████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░ -39 Done in 0.33s.
Requirements
If you want to use this in your console, you need to use node.js
>= 7.1
.
Installation as a global package
1. Install via npm
npm install -g git-stat-project
2. Use through console
git-stat-project --folder ~/projects/project --after 01.01.2017 --before 01.12.2017
Installation as separate project
1. Clone the repo
git clone git@github.com:gustarus/git-stat-project.git && cd git-stat-project
2. Use needed node.js version
nvm use
3. Install dependencies
yarn
Or via npm:
npm i
4. Use through console
Clone and install this project and then type in console from this project dir:
yarn start -- --folder ~/projects/project --after 01.01.2017 --before 01.12.2017
Or via npm:
npm start -- --folder ~/projects/project --after 01.01.2017 --before 01.12.2017
How you can use this in your project?
This code u can find in script.js.
const stat = ;const helpers Log GitProject CommitsReport LinesAffectedReport LinesDiffReport = stat;const getArgv = helpers; const folder before after = ;const reports = CommitsReport LinesAffectedReport LinesDiffReport; const log = ;const git = folder;git;
Which kinds of reports do you have?
Each report can be required with the following syntax (where collection
- git statistic results from GitProject
instance):
const GeneralReport = ;const report = collection;const records = report;return report;
GeneralReport
General report - commits pushed and lines affected ratio User name Percents value Commits Lines m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 16 691 abietis@gmail.com |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3 63 me@mrsum.ru |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 20 mrsum@mrsum.local |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1 4 a-ignatov-parc@users.noreply.github.com |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1 0
CommitsReport
Commits pushed report User name Total value ratio Commits m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 16 abietis@gmail.com |█████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3 me@mrsum.ru |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 a-ignatov-parc@users.noreply.github.com |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1 mrsum@mrsum.local |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1
LinesAddedReport
Lines added report User name Total value ratio Added m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 329 abietis@gmail.com |██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 12 me@mrsum.ru |██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10 mrsum@mrsum.local |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 a-ignatov-parc@users.noreply.github.com |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
LinesRemovedReport
Lines removed report User name Total value ratio Removed m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 362 abietis@gmail.com |███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 51 me@mrsum.ru |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 10 mrsum@mrsum.local |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2 a-ignatov-parc@users.noreply.github.com |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
LinesDiffReport
Lines diff report User name Total value ratio Diff a-ignatov-parc@users.noreply.github.com ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 me@mrsum.ru ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 mrsum@mrsum.local ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░ 0 m.chernobrov@rambler-co.ru ░░░░█████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░ -33 abietis@gmail.com █████████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░ -39
LinesAffectedReport
Lines affected report User name Total value ratio Affected m.chernobrov@rambler-co.ru |██████████████████████████████████████████████████ 691 abietis@gmail.com |█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 63 me@mrsum.ru |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 20 mrsum@mrsum.local |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4 a-ignatov-parc@users.noreply.github.com |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0
What does the module export?
// base componentsmoduleexportsBase = ;moduleexportsLog = ;moduleexportsGitProject = ;moduleexportsReport = ;moduleexportsKeyReport = ;moduleexportsTable = ; // key reportsmoduleexportsCommitsReport = ;moduleexportsLinesDiffReport = ;moduleexportsLinesAddedReport = ;moduleexportsLinesRemovedReport = ;moduleexportsLinesAffectedReport = ; // more complicated reportsmoduleexportsGeneralReport = ;