Skip to content

fix: preserve commit body in git log output#546

Merged
aeppling merged 1 commit intodevelopfrom
fix/git-log-body
Mar 13, 2026
Merged

fix: preserve commit body in git log output#546
aeppling merged 1 commit intodevelopfrom
fix/git-log-body

Conversation

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Summary

Closes #467

Test plan

  • 900 tests pass, 0 failures
  • Manual: rtk git log -5 shows bodies indented under headers
  • Manual: rtk git log --oneline still uses user format (no body injection)
  • Trailers (Signed-off-by, Co-authored-by) are filtered out
  • Token savings maintained (body adds ~1 line per commit with body)

Closes #467

git log now includes %b (body) in the format string and extracts the
first meaningful line (skipping Signed-off-by/Co-authored-by trailers),
displayed indented under the header. This preserves BREAKING CHANGE
notices, Closes references, and design context for LLM agents.

Also fixes resolved_command assertion in test and missing truncate
import in cargo_cmd.rs (both from PR #269 rebase).

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
@aeppling aeppling merged commit e189bbb into develop Mar 13, 2026
2 of 3 checks passed
pszymkowiak added a commit that referenced this pull request Mar 16, 2026
When user passes --oneline, --pretty, or --format, RTK correctly skips
injecting its custom format with ---END--- markers. However,
filter_log_output() still tried to split on ---END---, treating the
entire output as a single block and only preserving 2 lines.

Add user_format parameter to filter_log_output: when true, use simple
line-based truncation instead of ---END--- block splitting.

Fixes regression introduced in PR #546 (commit c3416eb).

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
pszymkowiak added a commit that referenced this pull request Mar 16, 2026
After the git log --oneline regression (PR #546), add a mandatory
review step: trace all callers of modified functions and verify every
input variant has a test. This prevents regressions where a function
is changed but only one code path is tested.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
pszymkowiak added a commit that referenced this pull request Mar 16, 2026
* fix: git log --oneline regression drops commits

When user passes --oneline, --pretty, or --format, RTK correctly skips
injecting its custom format with ---END--- markers. However,
filter_log_output() still tried to split on ---END---, treating the
entire output as a single block and only preserving 2 lines.

Add user_format parameter to filter_log_output: when true, use simple
line-based truncation instead of ---END--- block splitting.

Fixes regression introduced in PR #546 (commit c3416eb).

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* chore: add call-site analysis rule to code-reviewer agent

After the git log --oneline regression (PR #546), add a mandatory
review step: trace all callers of modified functions and verify every
input variant has a test. This prevents regressions where a function
is changed but only one code path is tested.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
maxkulish added a commit to maxkulish/rtk that referenced this pull request Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants