Skip to content

GitStats is a git repository statistics generator.

License

Notifications You must be signed in to change notification settings

kendallnelson/git_stats

This branch is 10 commits behind tomgi/git_stats:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a0be929 · Dec 1, 2017
Aug 15, 2013
Nov 28, 2017
Dec 1, 2017
Dec 1, 2017
Nov 28, 2017
Aug 15, 2013
Mar 30, 2014
Oct 12, 2012
Oct 6, 2016
Dec 1, 2017
Oct 8, 2012
Jun 29, 2016
Oct 23, 2012
Dec 1, 2017

Repository files navigation

GitStats Build Status Build Status

GitStats is a git repository statistics generator. It browses the repository and outputs html page with statistics.

Examples

Installation

Existing ruby/gem environment

$ gem install git_stats

Ubuntu

$ sudo apt-get install ruby
$ sudo gem install git_stats

Usage

Generator

Print help

$ git_stats
Commands:
  git_stats generate        # Generates the statistics of a repository
  git_stats help [COMMAND]  # Describe available commands or one specific command

Print help of the generate command

$ git_stats help generate
Usage:
  git_stats generate

Options:
  p, [--path=PATH]                          # Path to repository from which statistics should be generated.
                                            # Default: .
  o, [--out-path=OUT_PATH]                  # Output path where statistics should be written.
                                            # Default: ./git_stats
  l, [--language=LANGUAGE]                  # Language of written statistics.
                                            # Default: en
  f, [--first-commit-sha=FIRST_COMMIT_SHA]  # Commit from where statistics should start.
  t, [--last-commit-sha=LAST_COMMIT_SHA]    # Commit where statistics should stop.
                                            # Default: HEAD
  s, [--silent], [--no-silent]              # Silent mode. Don't output anything.
  d, [--tree=TREE]                          # Tree where statistics should be generated.
                                            # Default: .
  c, [--comment-string=COMMENT_STRING]      # The string which is used for comments.
                                            # Default: //

Generates the statistics of a repository

Start generator with default settings

$ git_stats generate
  git rev-list --pretty=format:'%h|%at|%ai|%aE' HEAD | grep -v commit
  git shortlog -se HEAD
  ...

Start generator with some parameters in long and short form.

$ git_stats generate -o stats --langugage de
  git rev-list --pretty=format:'%h|%at|%ai|%aE' HEAD | grep -v commit
  git shortlog -se HEAD
  ...

API usage example

> repo = GitStats::GitData::Repo.new(path: '.', first_commit_sha: 'abcd1234', last_commit_sha: 'HEAD')
> repo.authors
=> [...]
> repo.commits
=> [...]
> commit.files
=> [...]

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

About

GitStats is a git repository statistics generator.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 70.7%
  • HTML 14.9%
  • JavaScript 14.4%