Skip to main content

Conventional Commit messages, changelogs & PRs from git diffs using Gemma (local or cloud)

Project description

git-to-doc

Turn a git diff into developer documentation with a local or cloud Gemma model — Conventional Commit messages, markdown changelogs, and pull requests — straight from the terminal.

pip install git-to-doc

Why

Developers write terrible commit messages and skip doc updates. git-to-doc is the plumbing that fixes that: feed it a diff, get back a spec-valid commit, a changelog snippet, and a plain-English summary. It can also write your PRs and auto-fill commit messages via a git hook.

Backend (auto-detected)

  • Cloud: set OLLAMA_API_KEY (in a .env or your environment) → uses ollama.com.
  • Local: no key → uses a local ollama daemon (localhost:11434).

Commands

# diff → commit message + changelog + plain-English summary
git-to-doc sample.diff
git-to-doc https://github.com/pallets/flask/pull/5000 --output both
git-to-doc ./diffs/ --output md           # batch a folder
cat x.diff | git-to-doc --commit-msg -    # print ONLY the commit message

# generate (and open) a pull request from the current branch
git-to-doc pr                              # preview
git-to-doc pr --create                     # push + open via gh
git-to-doc pr --draft --base develop

# install a git hook so `git commit` (no -m) auto-fills the message
git-to-doc install-hook

# benchmark models (timing; add --judge for rubric quality + CC pass-rate)
git-to-doc-compare sample.diff --models gemma3:4b gemma3:12b --judge gpt-oss:120b

How it's built for trust

  • Self-repair loop — every generated commit is checked against the Conventional Commits spec (validate.py); on failure the exact violations are fed back and the model regenerates. Output is guaranteed spec-valid, not hopeful.
  • Structured output — Pydantic schemas force valid JSON from the model.
  • Measured, not guessedgit-to-doc-compare --judge scores models with an LLM-as-judge rubric and a deterministic Conventional Commit pass-rate.

Library use

from git_to_doc import analyze_diff, render_full_output
doc = analyze_diff(open("sample.diff").read(), model="gemma4")
print(render_full_output(doc))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_to_doc-0.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_to_doc-0.2.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file git_to_doc-0.2.0.tar.gz.

File metadata

  • Download URL: git_to_doc-0.2.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for git_to_doc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a9cd5c408843d035fab26cb6d30bd0a86af23d04b4140b0aa76ef7218f1a830
MD5 7eff80ccf82efe6ef38168bed44e0f0f
BLAKE2b-256 ad6c377a6a5485ad89f0b35b6d37dfc85f20a10146eabbe8b036beb8eae99289

See more details on using hashes here.

File details

Details for the file git_to_doc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: git_to_doc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for git_to_doc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3648e931c98d12b8edb960fbc181f8959460a8c7acc97722620cbb3fea0e7bb3
MD5 9afaec941239ca1690a60c4cb8ca4974
BLAKE2b-256 72b4421a4f68481959554ea3abb07bf1b6fa49d445d63fb1fbf291364dbc5f17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page