Skip to content

fix: git log --oneline regression drops commits#619

Merged
pszymkowiak merged 2 commits intodevelopfrom
fix/git-log-oneline-regression
Mar 16, 2026
Merged

fix: git log --oneline regression drops commits#619
pszymkowiak merged 2 commits intodevelopfrom
fix/git-log-oneline-regression

Conversation

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Summary

  • Fix regression from PR fix: preserve commit body in git log output #546 where git log --oneline (and --pretty, --format) only returned 2 commits instead of the requested count
  • Root cause: filter_log_output() always split on ---END--- markers, but those markers are only present when RTK injects its custom format
  • When user specifies their own format, use simple line-based truncation instead

Test plan

  • rtk git log --oneline -5 → 5 commits (was 2 before fix)
  • rtk git log --oneline -10 → 10 commits
  • rtk git log --pretty=format:"%h %s" -5 → 5 commits
  • rtk git log --format="%H" -3 → 3 commits
  • rtk git log -5 → 5 commits with RTK format (unchanged)
  • 43 git module tests pass, 2 new regression tests added

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>
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 pszymkowiak merged commit 8e85d67 into develop Mar 16, 2026
8 of 9 checks passed
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.

1 participant