GitStats is a git repository statistics generator.
Find a file
2017-04-04 23:57:04 -05:00
bin Modified the cli to base on thor gem. 2013-08-15 22:02:25 +02:00
config/locales quote unescaped ampersand at the beginning of a translation entry 2016-11-14 09:08:00 -05:00
lib use the --no-rename option to git statistics to match the expected insertions/deletions in spec tests; useful for test success on os x 2016-11-14 15:21:13 -05:00
spec use the --no-rename option to git statistics to match the expected insertions/deletions in spec tests; useful for test success on os x 2016-11-14 15:21:21 -05:00
templates Updated Highstock to v5.0.10 and added data export modules. This shouldn't require any new test cases. 2017-04-04 23:57:04 -05:00
.gitignore Ignore rvm or rbenv related dotfiles. 2013-08-15 12:51:11 +02:00
.gitmodules Implement git statistics on git trees (directories) 2014-03-30 08:01:39 +02:00
.rspec lazy loading and firsts tests 2012-10-12 18:20:07 +02:00
.travis.yml Updating ruby version used in Travis CI builds 2016-10-06 12:48:02 +02:00
Gemfile using my version of lazy_high_charts 2012-10-22 20:57:24 +02:00
git_stats.gemspec added missing json_pure dependency 2014-06-25 20:10:38 +02:00
LICENSE.txt initial gem 2012-10-08 17:11:11 +02:00
Rakefile spec is a default rake task 2012-10-23 21:57:27 +02:00
README.md Updated README.md: added installation for ubuntu 2016-06-29 11:11:24 +02:00

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