_ _
_ ( )_ ( )_
__ (_)| ,_) _ __ __ _ _ _ _ __ | ,_)
/'_ `\| || | ( '__)/'__`\( '_`\ /'_`\ ( '__)| |
( (_) || || |_ | | ( ___/| (_) )( (_) )| | | |_
`\__ |(_)`\__) (_) `\____)| ,__/'`\___/'(_) `\__)
( )_) | | |
\___/' (_)
A Ruby-based Git statistics tool that analyzes and displays commit statistics for all contributors in a repository, including lines of code, commit counts, and file changes.
- 📊 Display commit statistics per author
- 📈 Show added/deleted lines of code
- 🚀 Parallel processing for faster analysis
- 🔧 Works with any Git repository
- 🌐 Global
git report
command - 🔄 Automatic dependency management
- 💎 Compatible with Ruby 2.6 through 3.4+
Simply navigate to any Git repository and run:
git report
The tool will analyze the repository and display statistics for all contributors.
+-----------------+-----+---------+-------+------+------+
| Name | LOC | Commits | files | +LOC | -LOC |
+-----------------+-----+---------+-------+------+------+
| John Doe | 258 | 15 | 12 | 390 | 123 |
| Jane Smith | 87 | 8 | 5 | 125 | 38 |
+-----------------+-----+---------+-------+------+------+
- Git (any recent version)
- Ruby 2.6 or higher
- RubyGems (included with Ruby)
-
Clone the repository:
git clone https://github.com/wteuber/git_report.git cd git_report
-
Run the install script:
./bin/install
This will set up a global Git alias, allowing you to use git report
in any repository.
If you prefer manual installation:
- Clone the repository to your preferred location
- Add the git alias manually:
git config --global alias.report "!sh -c \"/path/to/git_report/bin/git_report\""
The tool will automatically install required gems on first run. If you prefer to install them manually:
cd /path/to/git_report
bundle install
Or without bundler:
gem install pmap activesupport bigdecimal
- Git Analysis: Uses
git log
andgit shortlog
to gather commit data - Parallel Processing: Utilizes the
pmap
gem for efficient processing of large repositories - Smart Dependency Management: Automatically handles Ruby version differences and gem installation
- Author Deduplication: Intelligently merges statistics for authors with multiple email addresses
git_report is designed to work across different Ruby versions and environments:
- ✅ Ruby 2.6 - 3.4+
- ✅ Works with system Ruby or version managers (rbenv, rvm, chruby)
- ✅ Handles bundler version conflicts automatically
- ✅ Installs gems locally when needed to avoid permission issues
If you encounter permission errors when installing gems, the tool will automatically install them to a local vendor directory.
The tool includes a .ruby-version
file specifying Ruby 2.6.10, but it works with any Ruby version 2.6 or higher. If you have issues with bundler compatibility (especially with Ruby 3.4+), the tool will automatically fall back to direct gem installation.
If you see errors about missing gems, run from the git_report directory:
cd /path/to/git_report
bundle install --path vendor/bundle
git_report/
├── bin/
│ ├── git_report # Main executable
│ ├── install # Installation script
│ └── uninstall # Uninstallation script
├── lib/
│ ├── git_report.rb # Main library file
│ └── git/
│ ├── author.rb # Author statistics class
│ └── report.rb # Report generation class
├── Gemfile # Ruby dependencies
├── .ruby-version # Ruby version specification
└── README.md # This file
Currently, this project doesn't include tests. Contributions to add a test suite are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
To remove git_report:
cd /path/to/git_report
./bin/uninstall
This will remove the global Git alias. You can then delete the git_report directory.
This project is open source and available under the MIT License.
- Original ASCII art logo design
- Built with Ruby and the power of Git
- Special thanks to all contributors
- Repository: https://github.com/wteuber/git_report
- Issues: https://github.com/wteuber/git_report/issues
- Pull Requests: https://github.com/wteuber/git_report/pulls