Skip to content

saurabhv749/gitlines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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