Skip to main content

gitlines

Analyze git commits with detailed per-file line statistics and running totals. See exactly how your codebase evolved over time!

Python 3.8+ License MIT PyPI

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

screenshot-1 screenshot-2

How it works

  1. Fetches all commits in chronological order (oldest → newest)
  2. 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
  3. 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

Metadata

Release files for gitlines 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitlines 1.0.1
File Size Uploaded
gitlines-1.0.1.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitlines 1.0.1
File Interpreter ABI Platform
gitlines-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / gitlines-1.0.1.tar.gz

Download URL gitlines-1.0.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5ba5c8667b7808d307e296cd0950598f2b56ac4e197ccd43f8901442236f2cb
BLAKE2b-256 checksum
How to use checksums
0c0e0311e77a18202b54c3cd0e7ff635b740fa513576d82e279a77fa53df0eb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / gitlines-1.0.1-py3-none-any.whl

Download URL gitlines-1.0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42a13409c56cfcd90537c5ac7755ff5a5781aa77291e24784fe5018589e35069
BLAKE2b-256 checksum
How to use checksums
c8ab1db98c2ab9cd2f71b4bb48aaa1e8502429ca0435446b2f4f5902a5406753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page