rtk-ai/rtk

git log --stat output passes through uncompressed

Open

#611 ouverte le 15 mars 2026

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)Rust (2 914 forks)batch import
area:clieffort-mediumenhancementfilter-qualityhelp wantedpriority:medium

Métriques du dépôt

Stars
 (48 085 stars)
Métriques de merge PR
 (Merge moyen 11j 1h) (45 PRs mergées en 30 j)

Description

Problem

rtk git log --stat passes the stat block through byte-for-byte without compression. The per-commit format line is compressed (one-liner with hash, subject, date, author), but the --stat file listing after each commit is unmodified.

Verified with direct comparison:

$ rtk proxy git log --stat -5 2>&1 | wc -c
6244
$ rtk git log --stat -5 2>&1 | wc -c
6244

Byte-for-byte identical. rtk gain shows 0.8% savings on git log --stat vs 64-99% on other git subcommands.

Why it matters

git log --stat is commonly used by agents to understand what files changed in recent commits before making edits. rtk discover shows git log as 629 invocations / ~80.4K tokens saveable across 30 days. A significant portion of those include --stat or --numstat.

The stat block is highly compressible — it's a list of filenames with insertion/deletion counts and histogram bars. The histogram bars (| 11 ++++, | 75 ++++++------) are the most obvious waste: they're a visual representation of data already shown numerically.

Expected behavior

At minimum, strip the histogram bars and collapse the stat summary. For example:

Current (passthrough):

598afb5 feat: repo map, checkpointing, research (6 hours ago) <Peter J McDade>
 commands/checkpoint.md                             |  31 +++
 commands/map.md                                    |  15 ++
 commands/rollback.md                               |  47 ++++
 docs/specs/2026-03-15-agent-checkpointing-design.md | 107 ++++++++
 docs/specs/2026-03-15-repo-map-design.md           | 269 +++++++++++++++++++++
 operations/chalk/hooks/chalk-repo-map.sh           | 245 +++++++++++++++++++
 15 files changed, 1235 insertions(+), 1 deletion(-)

Suggested (compressed):

598afb5 feat: repo map, checkpointing, research (6 hours ago) <Peter J McDade>
 commands/checkpoint.md (31+) | commands/map.md (15+) | commands/rollback.md (47+)
 docs/specs/2026-03-15-agent-checkpointing-design.md (107+)
 docs/specs/2026-03-15-repo-map-design.md (269+)
 operations/chalk/hooks/chalk-repo-map.sh (245+)
 15 files, +1235 -1

Or any other compact representation — the key is that the histogram bars and padding whitespace are pure noise for LLM context.

Environment

  • rtk v0.29.0 (stable)
  • Hook-based usage via PreToolUse rewrite
  • Linux (CachyOS)

Related

  • PR #546 (merged to develop) fixed commit body preservation — same area of the git log filter
  • Issue #467 reported body stripping; --stat is the other half of the same problem (useful git log data being lost or not compressed)

Guide contributeur