← Back to all projects

Git Evolution

See how your code evolved by language over time: one command, one interactive HTML report ready to share.

Real demo: report generated by running uv run main.py inside this very portfolio.Open fullscreen →

Key Features

Chain of Responsibility Pipeline

Five chained steps (Fetch → Parse → Accumulate → Plot → Render) that enrich a shared context, easy to extend with new handlers.

Zero-Config with uv (PEP 723)

Inline script metadata lets uv resolve Python and plotly on the fly with `uv run main.py`, no venvs or global installs needed.

Regex-Free Performance

`git log --numstat` parsing uses strict line-by-line string scanning to minimize CPU cost on long histories.

Standalone Binary

`build.sh` orchestrates PyInstaller in onefile mode through uv: a self-contained executable that embeds the HTML template and needs no Python at runtime.

How It Works

  1. 1.Fetch: runs `git log --numstat`, `git rev-parse` and `git rev-list` to capture history, repo name and commit count.
  2. 2.Parse: scans the log line by line tallying added/removed lines per extension and date.
  3. 3.Accumulate: turns daily deltas into cumulative series per extension.
  4. 4.Plot: builds the dark Plotly figure with an explicit date range, preventing autorange collapse on tiny repositories.
  5. 5.Render: injects the figure and metadata into template.html producing the self-contained git-evolution.html.

Explore the Code

Review the full pipeline architecture in the official repository.

View on GitHub