Analyze git commits with per-file line statistics and running totals
Project description
gitlines
Analyze git commits with detailed per-file line statistics and running totals. See exactly how your codebase evolved over time!
Features
- 📊 Detailed commit analysis: Insertions, deletions, and total lines per commit
- 📈 Running totals: Track how file line counts evolved over time
- 🎨 Beautiful terminal output: Color-coded statistics for easy scanning
- 📁 Per-file breakdown: See which files changed the most in each commit
- 🏆 Summary statistics: Top files by line count with visual progress bars
- 🔄 Chronological order: Commits processed from oldest to newest
- 🚫 Smart color handling: Disables colors when output is piped
Installation
Via pip (recommended)
pip install gitlines
Manual installation
git clone https://github.com/saurabhv749/gitlines.git
cd gitlines
pip install -e .
Usage
Navigate to any git repository and run:
gitlines
This will output a detailed analysis of every commit, including:
- Commit hash and date
- Total insertions and deletions
- Running total of lines in repository
- Per-file breakdown for each commit
- Summary statistics and top files
Example Output
How it works
- Fetches all commits in chronological order (oldest → newest)
- For each commit:
- Gets file-level insertions and deletions using
git show --numstat - Updates running total for each file
- Displays statistics with color-coded output
- Gets file-level insertions and deletions using
- Shows final summary with top files by line count
Requirements
- Python 3.8+
- Git (installed and in PATH)
- Any operating system: macOS, Linux, Windows
Options
Currently gitlines has no command-line flags. Run it from any directory inside a git repository.
Future versions may support:
--no-color- Disable colored output--json- Output as JSON--since <date>- Analyze commits since specific date--until <date>- Analyze commits until specific date
Contributing
Contributions are welcome! Please feel free to submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Created with ❤️ for developers who want to understand their codebases better.
Changelog
v1.0.0 (2024-01-15)
- Initial release
- Commit analysis with per-file statistics
- Color-coded terminal output
- Running line count tracking
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitlines-1.0.1.tar.gz.
File metadata
- Download URL: gitlines-1.0.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5ba5c8667b7808d307e296cd0950598f2b56ac4e197ccd43f8901442236f2cb
|
|
| MD5 |
4fdbfe17fc3ad5e875fdb796d0c51ca9
|
|
| BLAKE2b-256 |
0c0e0311e77a18202b54c3cd0e7ff635b740fa513576d82e279a77fa53df0eb7
|
File details
Details for the file gitlines-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gitlines-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42a13409c56cfcd90537c5ac7755ff5a5781aa77291e24784fe5018589e35069
|
|
| MD5 |
cdd75a2895ef7e860ecb079e62629628
|
|
| BLAKE2b-256 |
c8ab1db98c2ab9cd2f71b4bb48aaa1e8502429ca0435446b2f4f5902a5406753
|