Skip to content

fix(git): preserve trailing newline on status --short/--porcelain (#3303) - #3307

Open
NanoRisk6 wants to merge 1 commit into
rtk-ai:developfrom
NanoRisk6:cat/git-status-trailing-newline-3303
Open

fix(git): preserve trailing newline on status --short/--porcelain (#3303)#3307
NanoRisk6 wants to merge 1 commit into
rtk-ai:developfrom
NanoRisk6:cat/git-status-trailing-newline-3303

Conversation

@NanoRisk6

@NanoRisk6 NanoRisk6 commented Jul 30, 2026

Copy link
Copy Markdown

What Problem This Solves

rtk git status --short / --porcelain filtered output was emitted with print! after join("\n"), so the final entry had no trailing newline. That breaks while read loops and glues the last line to following output. Fixes #3303.

Why This Change Was Made

Print status output with a trailing newline when the filtered file list is non-empty, matching native git status --short / --porcelain behavior.

User Impact

Scripts and agent parsers that read status line-by-line work correctly again.

Evidence

  • Focused unit/integration coverage for short/porcelain trailing newline.
  • Local cargo test for the status filter path.

…k-ai#3303)

Non-compact status used join + print!, dropping the final newline so
shell pipelines and read loops missed the last entry.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

git status --short/--porcelain output loses its trailing newline

2 participants