Transform Git diffs into rich, interactive, self-contained HTML reports
Project description
DiffStory
Transform Git diffs into rich, interactive, self-contained HTML reports.
DiffStory turns any git diff into a beautiful, portable HTML report that answers not just what changed, but who changed it, when, and why — all offline, in a single file.
pip install diffstory
cd my-repo
diffstory --staged -o report.html
# Open report.html in any browser
Features
Phase 1 (MVP)
- Unified View — Classic git-style diff with syntax highlighting
- Side-by-Side View — Original and modified columns, synchronized
- Inline Edit View — Word-level diff showing exact token changes
- Syntax Highlighting — 30+ languages via Pygments, light + dark themes
- Statistics Dashboard — Files changed, +/-, authors breakdown
- File Sidebar — Navigate files with search, collapse/expand
- Keyboard Shortcuts —
U/S/Ito switch views,Dfor theme,Escto close - Theme Toggle — Light/dark with system preference detection and persistence
- Export Formats — HTML, JSON, Markdown, CSV
Phase 2 (Blame Integration)
- Blame Tooltips — Hover any changed line to see author, commit, date, and message
- Commit Drawer — Click a line to open a detailed side panel with full commit metadata
- Relative Time — "2h ago", "3d ago" for at-a-glance recency
Future Phases
- Search across filename, author, commit message, and code content
- Filtering by author, date range, file type, change type
- Commit evolution viewer and timeline
- Deep linking to specific lines and files
Installation
From PyPI (once published)
pip install diffstory
From source
git clone https://github.com/user/diffstory.git
cd diffstory
pip install -e .
Requirements: Python 3.10+, Git
Usage
Basic Commands
# Working tree diff
diffstory
# Staged changes
diffstory --staged
# Compare commits
diffstory HEAD~3 HEAD
# Compare branches
diffstory main feature
# Custom output file
diffstory -o my-report.html
# Multiple export formats
diffstory --staged --json --md --csv -o report
Keyboard Shortcuts (in the HTML report)
| Key | Action |
|---|---|
U |
Unified view |
S |
Side-by-side view |
I |
Inline edit view |
D |
Toggle theme |
Esc |
Close drawer / stats panel |
F |
Focus file search |
Report Features
Three View Modes
| Mode | Description |
|---|---|
| Unified | Classic git diff format with line numbers |
| Side-by-Side | Two-column layout — original on left, modified on right |
| Inline Edit | Word-level diff showing additions (green) and removals (red strikethrough) within the same line |
Blame Tooltips (Phase 2)
Hover over any changed line to see:
- Author name
- Commit hash (short, 7 chars)
- Commit subject
- Date with relative time ("2h ago")
Click any line to open the Commit Drawer with full metadata: body, committer, parents, files changed, insertions/deletions.
Statistics
The statistics panel shows:
- Files changed, additions, deletions
- Added / deleted / modified / renamed file counts
- Top 10 most-changed files with per-file breakdown
Output
Reports are fully self-contained single HTML files:
- All CSS inlined
- All JavaScript inlined
- All data embedded as JSON
- No external dependencies
- Works offline in any modern browser
- Safe to email or archive
Project Structure
diffstory/
├── pyproject.toml # Build config & entry point
├── requirements.md # Full product requirements
├── .gitignore
├── src/diffstory/
│ ├── __init__.py # Package version
│ ├── __main__.py # python -m diffstory
│ ├── cli.py # CLI argument parsing & orchestration
│ ├── git_utils.py # Git subprocess wrappers
│ ├── diff_parser.py # Unified diff → structured data
│ ├── syntax.py # Pygments syntax highlighting
│ └── html_generator.py # Self-contained HTML report generation
└── tests/
└── __init__.py
Development
# Install in editable mode
pip install -e .
# Run against a test repo
cd /tmp && mkdir test && cd test
git init
echo "hello" > test.py
git add -A && git commit -m "init"
echo "world" >> test.py
diffstory
Security
DiffStory is designed for air-gapped, audit-safe use:
- Never uploads code
- Never transmits data
- No telemetry
- No accounts required
- No external API calls
- Never modifies your repository
License
MIT
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 diffstory-0.2.0.tar.gz.
File metadata
- Download URL: diffstory-0.2.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c78be609e593eb0ef0b066c8e4a30b483f5f00f3da6a85af687fac503b41e13b
|
|
| MD5 |
741a2f8ef3b15bbc4e81baf916b28b74
|
|
| BLAKE2b-256 |
504215c9695a98dc182aa49a8c4a5cb69b51615ae65dd007dd242a2b0f582f91
|
File details
Details for the file diffstory-0.2.0-py3-none-any.whl.
File metadata
- Download URL: diffstory-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6bae9a03269fff610d26f8a36d389b9f95e6368345e0f8e85cfb5042281c3ad
|
|
| MD5 |
6f5820e4a3c5f7abc367dbf6cb9cd66a
|
|
| BLAKE2b-256 |
025a1e8ed8c0dd773b733c6b8bf8ee90bbb75f2a8a85bfba39f5f4288cecdd14
|