re0-git
re0 for git: rewrite a finished commit's message so the log hands off on its own — in the author's own voice, not an imposed one.
Goal
Repeated amends and momentum-commits leave a message bloated, stale, or padded with trivia. re0-git applies re0 to the message: a clean version that lets a fresh session continue from git log alone, without reading the diff. It refines what the author already writes — it never imposes a format, and it never makes a commit. Only the message moves — and timestamps, per the date rule below; the tree never changes.
It is user-invoked — you run it once you've decided to commit. Deliberately not model-invoked and not chained from tasting: a commit-cleanup tool sitting in the agent's reach would bias it toward committing when it shouldn't, so it's kept out of that reach entirely.
Workflow
- Scope the target — usually
HEAD, sometimes a short unpushed range. A commit must already exist; re0-git never creates one. - Read two things: what actually changed (
git show --stat,git diff) so the message is true, and the author's recentgit logso you match how they write — a one-line head, or a subject with bullets, terse or prose, whatever it is. - Rewrite the message in that style, keeping only what carries the change for a handoff. Cut the rest: stale or half-true lines, restated context, and mechanical or derivable trivia (version bumps, file registration, "also updated X"). One point per real change — never pad to a length.
- Re-commit signed, with dates per the rule below: for the tip you're finalizing (
HEAD), a plaingit commit --amend -Slets both dates default to now; to keep an older commit's dates, rebuild it withGIT_AUTHOR_DATE/GIT_COMMITTER_DATE git commit-tree <tree> -p <parent> -Sand move the branch ref. For a range, the tip restamps and the rest preserve. - Verify and report.