Skip to content

fix(git): preserve full status paths and untracked files#991

Open
em0t wants to merge 8 commits intortk-ai:developfrom
em0t:fix/git-completeness
Open

fix(git): preserve full status paths and untracked files#991
em0t wants to merge 8 commits intortk-ai:developfrom
em0t:fix/git-completeness

Conversation

@em0t
Copy link
Copy Markdown
Contributor

@em0t em0t commented Apr 3, 2026

Summary

  • switch default rtk git status to --porcelain -b -uall so dirty paths are no longer hidden behind grouped summaries, overflow markers, or directory-level collapse
  • preserve RTK's status framing (* branch, clean — nothing to commit) while keeping every dirty path visible
  • add focused regression coverage for default status behavior, explicit-args passthrough, rename/conflict preservation, and untracked directory expansion

Minimal Cases

rtk git status Hidden Dirty Paths

Previous RTK (develop)

* main
~ Modified: 17 files
   src/file01.rs
   src/file02.rs
   ...
   src/file15.rs
   ... +2 more

This PR

* main
 M src/file01.rs
 M src/file02.rs
 ...
 M src/file15.rs
 M src/file16.rs
 M src/file17.rs

Untracked Directory Expansion

Raw

On branch main
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	tmp/

nothing added to commit but untracked files present (use "git add" to track)

Previous RTK (develop)

* main
? Untracked: 1 files
   tmp/

This PR

* main
?? tmp/c.txt
?? tmp/nested/d.txt

Testing

  • cargo fmt --all
  • cargo clippy --all-targets
  • cargo test --all

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

@em0t em0t force-pushed the fix/git-completeness branch from 1b1f947 to 359daa5 Compare April 3, 2026 09:36
@em0t em0t changed the base branch from master to develop April 3, 2026 09:36
@em0t em0t force-pushed the fix/git-completeness branch from 359daa5 to 2b61126 Compare April 3, 2026 09:39
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
@em0t em0t force-pushed the fix/git-completeness branch from 2b61126 to 481103d Compare April 3, 2026 10:09
@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 3, 2026

Could a maintainer please approve and run workflows so CI can start for review?

@aeppling aeppling self-assigned this Apr 3, 2026
@aeppling aeppling added the filter-quality Filter produces incorrect/truncated signal label Apr 3, 2026
@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Apr 3, 2026

Hello @em0t

Thanks for those contributions !

I'll review this today , currently focusing on bugs and filters quality.

Did you check if there was any issues related to your 4 PRs ?

@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 3, 2026

Thanks @aeppling. I didn’t find existing upstream issues specifically tracking these 4 cases.

These 4 PRs came from an internal local A/B evaluation we ran while assessing RTK for rollout in our team. We used Claude Code + Codex, wrote up a report, and these were the main issues we found. I split them into 4 small PRs by issue category to keep review clearer and each fix easier to reason about.

Also yes, all 4 PRs include automated regression tests for the behavior they change, and I ran cargo fmt --all, cargo clippy --all-targets, and cargo test --all locally on each branch.

To be transparent, I haven’t manually reproduced every case end-to-end by hand yet.

@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Apr 3, 2026

Ok thanks, passing by this i see the output of git status is :

Modified files:
  src/a.rs
  src/b.rs
Untracked files:
  tmp/c.txt

But actually, isn't "modified" and "untracked" enough for LLM to understand and compress a bit more ?
Since we are removing some filters part, would be interesting to add this if it make sense for you so we still get nice compression globally on git commands

@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 3, 2026

Yes, that makes sense. I’ll follow up with a smaller optimization for the git status formatting afterwards.

@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Apr 3, 2026

Thank you !

@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 3, 2026

@aeppling Follow-up pushed in this PR. Default git status now keeps every dirty path visible but switches the default output to porcelain-like status lines (##, M , ??) instead of grouped labels, so it compresses better without hiding files. I also removed the now-dead status limit config/docs and re-ran cargo fmt --all --check, cargo clippy --all-targets, and cargo test --all locally; clippy still shows the same pre-existing warnings outside this diff.

@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 3, 2026

Thanks for the review. I narrowed this PR further to keep the scope as small as possible.

Changes since the last round:

  • kept the scope in src/cmds/git/* only; no core config changes
  • preserved the existing RTK status framing (* branch, clean — nothing to commit)
  • kept only the behavior fixes:
    • default rtk git log no longer hides merge commits
    • default rtk git status no longer hides dirty paths and now expands untracked directories via -uall
  • reduced the regression coverage to the focused cases for these behaviors
  • updated the PR description to match the current behavior

Would appreciate another look when you have a moment. If anything still feels broader than it should be, I can trim it further.

@em0t em0t changed the title fix(git): preserve merge commits and full status paths fix(git): preserve full status paths and untracked files Apr 4, 2026
@em0t
Copy link
Copy Markdown
Contributor Author

em0t commented Apr 4, 2026

@aeppling I thought about it more and removed the git log merge-commit change from this PR.

What’s left is just the two git status correctness fixes: preserving all dirty paths and expanding untracked directories.

Would appreciate another review when you have a chance.

@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Apr 7, 2026

Hey @em0t

Additional thoughts , you bypass the porcelain flag addition when user run a "git status" cmd without arguments.
But in case user run "git branch -b", we could also catch to still gain token (if git status -b for eg.) Since we add -b in flags that could make sense to catch as well for compress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filter-quality Filter produces incorrect/truncated signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants