fix(git): preserve --format output verbatim (no-merges bypass + no line truncation)#1187
Open
ousamabenyounes wants to merge 1 commit into
Open
Conversation
5 tasks
b0c9030 to
b46c8ad
Compare
…t/--pretty Two bugs affected `git log` with custom format flags: 1. RTK added `--no-merges` even for custom `--format`/`--pretty`/`--oneline` requests. Scripting users rely on exact commit selection (e.g. reading the date of a merge commit at HEAD); silently skipping merges causes the wrong commit to appear. 2. `filter_log_output` truncated individual lines at 80 chars when `user_format=true`. This corrupts programmatic output — full 40-char SHAs, ISO date strings, and any line longer than 80 chars were silently cut. Fix: when `has_format_flag=true`, skip `--no-merges` injection and copy output lines verbatim (no per-line truncation). RTK still applies the commit-count cap (-50 default or user's -N) so output stays bounded. Closes rtk-ai#1058 Co-Authored-By: Claude <noreply@anthropic.com>
b46c8ad to
9e644a6
Compare
ogizanagi
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1058 —
git log --formatplaceholders mangled by rtk proxy.Two bugs in
run_logcorrupted output when users specified custom format flags:--no-mergesinjected for custom formats: RTK added--no-mergeseven when the user passed--format,--pretty, or--oneline. For scripting use cases (date extraction, SHA lookups, changelog generation), this causes a different commit to appear when HEAD is a merge commit — the format output looks wrong even though the format string is passed through correctly.Per-line truncation at 80 chars:
filter_log_outputtruncated each line at 80 characters whenuser_format=true. This corrupts programmatic output — 40-char full SHAs, ISO date strings, and any custom field longer than 80 chars are silently cut.Changes
run_log: skip--no-mergesinjection whenhas_format_flag=truefilter_log_output: whenuser_format=true, copy lines verbatim instead of callingtruncate_line. RTK's only contribution in this path is the commit-count cap (-50default or user's-N).test_filter_log_output_user_format_no_line_truncation— 40-char SHAs must not be cuttest_filter_log_output_user_format_multiline— multi-line formats (%H%n%s) must not lose commitsTest plan
cargo test test_filter_log_output_user_format— 4/4 passcargo test --all— 1373 pass, 0 regressions🤖 Generated with Ora Studio
Vibe Coded by Ousama Ben Younes
Developed With Ora Studio (Claude Code)