fix(git,search,dotnet): correct the flag classes the last round got wrong
`-W`/`--function-context` does not make `git log` emit a patch -- checked against git 2.53, where it is byte-identical to plain log -- so routing it raw turned `rtk git log -W` into a 1 MB unfiltered dump of the whole history. The flags that *do* imply a patch there are `-U<n>` and the combined-diff forms `--cc`/`-c`/`--remerge-diff`, whose patch the log compaction was discarding with no tee to recover it from. That raw route is `run_passthrough`, which streams straight to the terminal, so RTK's default limit has to be in the args or it never applies at all: every one of those spellings printed the entire history, 411k lines against 50 for plain `rtk git log`. It now carries `-10` whenever the user named no limit of their own -- the limit only, since `--no-merges` would gut `--cc`/`-c`, whose whole purpose is the merge diff. `--exit-code` and `--quiet` are `diff`'s, not `log`'s. Both leave `git log`'s output byte-identical to plain log, so there is no shape for it to escape to, and claiming them cost the whole history for nothing. In `diff` they do earn the raw route: the body is replaced by a report and git exits non-zero, which RTK's stat probe inherited, its early return on failure then throwing the entire diff away. They join `--check`, whose handling already existed for the same reason. `--quiet` then splits `diff` from `show`, so each states its own raw-output grammar rather than sharing one. In `show` it is a synonym of `-s` -- exit 0, body suppressed -- so it belongs on the compact path with `-s`/`--no-patch`, where the summary is exactly what it asks for; claiming it raw-passed the very header its synonyms compact. That split's short-flag rule holds for `-p`/`-u`/`-U`, which only restate `diff`/`show`'s patch default, but not for `-c`: it is `--cc`'s combined-diff form, and `compact_diff` reads a combined diff's two marker columns as one, so `git show -c` on a merge came back as `+54 -8` against git's own 156 insertions and 0 deletions. It takes the raw route its long form already took. `--diff-merges=<format>` names those same shapes a second way, so it routes on the format rather than on the flag: every value but `off`/`none` emits a patch, which `log` cannot compact, while only `c`/`cc`/`combined`/`dense-combined` produce the two marker columns, which is all `show` needs the raw route for. Both value spellings count -- git takes the format attached or as the next token, and `git log --diff-merges c` is accepted. `--unified=5` and `-U5` are one option and now take one path. `run_show`'s format gate keeps `--oneline` out, unlike `run_log`'s: there the gate routes the whole command to a raw passthrough, and `--oneline` only means the user's one-line summary outranks RTK's own one-line summary. Claiming it gave up compaction entirely to fix that -- 116 KB against 31 KB on a real commit, on the one metric this tool exists for. `git worktree`'s write actions compact to "ok" again unless the user asked for a report with `--dry-run`/`-n` or `--verbose`/`-v`. Keeping every non-empty report was meant for `prune --dry-run`, whose list is the point of the command, but `add` also speaks on success: its two progress lines came back instead of "ok", and in the wrong order, since one is on stdout and the other on stderr. search: the `=`-unwrapping applies to the attached spelling only. Applied to a separate-token value it ate the first character of the user's pattern, so `rtk rg -e '=='` searched for `=` and matched lines the real command does not. And the filename negation is engine-specific in both directions -- grep's `-h` is `--no-filename` where rg's is `--help`, and rg's `-I` is `--no-filename` where grep's is `--binary-files` -- so rg's spelling was forwarded, beat RTK's `--with-filename`, and ran the whole search a second time. `-N` and `--no-line-number` are ripgrep's alone for the same reason: grep 3.12 exits 2 on both, so recognising them there reported a match for a command the engine refuses to run. Recursion is not a filename request. `-r`/`-R`/`--recursive` shared the last-spelling-wins slot with `-H`/`-h`, which made the result depend on typing order -- `grep -rh` dropped the prefix and `grep -hr` kept it, where real grep drops it either way, because `-r` only makes the search span several files. It now feeds the fallback that the paths already feed, and only `-H`/`-h` override. dotnet: the `-l` alias is single-dash only. `--l` is not a spelling dotnet accepts, so treating it as the logger suppressed RTK's injection for a command that then wrote no TRX at all. Two tests were asserting less than they appeared to: the stdin fixture lived inside the directory being searched, so an engine that ignored stdin and walked the cwd still produced the asserted line, and the blob-show test built its tokens with log's grammar where `run_show` uses diff's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
N
Nicolas Le Cam committed
7931993da88965074c3e00dc6b6c116cb58b4b7a
Parent: e622c2e