fix: support git global options (-C, -c, --git-dir, --work-tree, --no-pager, --no-optional-locks, --bare, --literal-pathspecs)#192
Merged
aeppling merged 3 commits intortk-ai:masterfrom Mar 3, 2026
Conversation
edsai
added a commit
to edsai/rtk
that referenced
this pull request
Feb 19, 2026
The hook rewrites `grep -rn` to `rtk grep -rn`, but Clap rejected `-r` as an unknown flag. This caused "unexpected argument" errors that prevented rtk from filtering grep output. - Add `-r`/`--recursive` as a no-op flag (rg is recursive by default) - Add `-i`/`--ignore-case` as a proper flag that passes through to rg - Fix test compilation: add empty global_args to run_branch and build_commit_command calls, add `..` to ignore new Git fields - Update git -C test to expect success (PR rtk-ai#192 added -C support) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
edsai
added a commit
to edsai/rtk
that referenced
this pull request
Feb 19, 2026
The hook rewrites `grep -rn` to `rtk grep -rn`, but Clap rejected `-r` as an unknown flag. This caused "unexpected argument" errors that prevented rtk from filtering grep output. - Add `-r`/`--recursive` as a no-op flag (rg is recursive by default) - Add `-i`/`--ignore-case` as a proper flag that passes through to rg - Fix test compilation: add empty global_args to run_branch and build_commit_command calls, add `..` to ignore new Git fields - Update git -C test to expect success (PR rtk-ai#192 added -C support) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
edsai
added a commit
to edsai/rtk
that referenced
this pull request
Feb 19, 2026
The hook rewrites `grep -rn` to `rtk grep -rn`, but Clap rejected `-r` as an unknown flag. This caused "unexpected argument" errors that prevented rtk from filtering grep output. - Add `-r`/`--recursive` as a no-op flag (rg is recursive by default) - Add `-i`/`--ignore-case` as a proper flag that passes through to rg - Fix test compilation: add empty global_args to run_branch and build_commit_command calls, add `..` to ignore new Git fields - Update git -C test to expect success (PR rtk-ai#192 added -C support) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
This PR should also cover |
|
👀 Why does rtk error instead of doing a raw passthrough for valid but unhandled options / subcommands? |
443cc4e to
9ad9dbd
Compare
Contributor
Author
@pszymkowiak Rebased and added support for these options. |
heAdz0r
added a commit
to heAdz0r/rtk
that referenced
this pull request
Feb 28, 2026
…tk-ai#217, rtk-ai#196, rtk-ai#248, rtk-ai#211, rtk-ai#200, rtk-ai#192, rtk-ai#268) Wave 1 (critical bugs): - fix(registry): fi/done moved to IGNORED_EXACT — find no longer shadowed (rtk-ai#246) - fix(playwright): f64 duration, specs[] structure, --reporter=json after subcmd (rtk-ai#193) - fix(gh): should_passthrough_gh_view for --json/--jq/--template/--web in view_pr/issue/run (rtk-ai#217+196) Wave 2 (reliability): - fix(git): is_blob_show_arg — blob show passthrough without trailing-newline trim (rtk-ai#248) - fix(find): parse_find_args with native -name/-type/-maxdepth/-iname support (rtk-ai#211) - fix(main): graceful Clap fallback + parse_failures SQLite table + rtk gain --failures (rtk-ai#200) Wave 3 (UX): - feat(git): global options -C/-c/--git-dir/--work-tree/--no-pager/--no-optional-locks/--bare/--literal-pathspecs (rtk-ai#192) - feat(proxy): streaming output via spawn()+threads instead of buffered output() (rtk-ai#268) Tests: 1091 → 1117 (+26), 0 regressions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Please rebase on master before we can merge — there are conflicts in |
git -C <path> and other global options were rejected because Clap expected a subcommand immediately after `git`. Add these options to the Git command variant and thread them through all git subcommand handlers via a git_cmd() helper that prepends global args before the subcommand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-locks, --bare, --literal-pathspecs) Extends the existing git global options support to accept boolean flags that the hook already strips for subcommand matching but Clap was rejecting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9ad9dbd to
eed0188
Compare
Contributor
Author
@pszymkowiak Done. |
Collaborator
|
Hi, this PR has conflicts with master in |
Contributor
|
merged will be available in next release |
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
-C,-c,--git-dir,--work-tree(value-taking options)--no-pager,--no-optional-locks,--bare,--literal-pathspecs(boolean flags)rtk-rewrite.sh) already strips these flags for subcommand matching, but RTK's Clap definition was rejecting them at parse timeTest plan
rtk git --no-pager --no-optional-locks statusparses correctlygit_cmd()test: boolean flags are prepended before subcommand argscargo test)cargo fmt --all --checkpassescargo clippy --all-targetspasses (no new warnings)🤖 Generated with Claude Code