rtk icon indicating copy to clipboard operation
rtk copied to clipboard

git log filter strips commit bodies that agents need for context

Open wouter-intveld opened this issue 8 months ago • 1 comments

Problem

rtk git log compresses output to a single-line-per-commit format, stripping commit bodies entirely:

1d0de01 feat(init): add --opencode flag (8 hours ago) <Wouter in 't Veld>
b9cb238 chore(master): release 0.28.0 (#378) (5 hours ago) <github-actions[bot]>

While this saves tokens for quick history scans, it removes information that AI agents actively rely on:

  • Commit bodies — the "why" behind changes, design decisions, migration notes
  • Breaking change notices — BREAKING CHANGE: footers in conventional commits
  • Issue/PR references — Closes #123, Fixes #456 in the body
  • Co-author attributions — Co-authored-by: trailers

When an agent runs git log to understand recent changes before making edits, the body is often more valuable than the subject line. Stripping it can lead to the agent missing context and making worse decisions.

Example

A commit like:

feat(auth): switch to JWT tokens

Replaced session-based auth with JWT to support stateless API scaling.
The refresh token rotation follows OWASP guidelines.

BREAKING CHANGE: /api/login response shape changed — `session_id` replaced by `access_token` + `refresh_token`.

Closes #234

Becomes just:

a1b2c3d feat(auth): switch to JWT tokens (2 days ago) <dev>

The agent misses the breaking change, the design rationale, and the issue link.

Suggestion

Consider preserving commit bodies by default for rtk git log, or at least when the agent explicitly asks for detail (e.g., git log -p, git log --format=full, git show). The subject-only format could be reserved for git log --oneline where the user already opted for brevity.

Alternatively, a flag like --full or --body to opt into including bodies would work, as long as the default doesn't silently discard context that agents depend on.

wouter-intveld avatar Mar 10 '26 15:03 wouter-intveld

Fixed in PR #546 (merged to develop) — commit bodies are now preserved in rtk git log output.

pszymkowiak avatar Mar 13 '26 08:03 pszymkowiak