fix(git,search,go,dotnet): adapt the consumers tuned to the old parse
A fuzz batch against raw git and develop caught five places where the
tokenizer is now right and the code reading it still assumed the old,
looser parse.
`diff` and `show` reported success for commands git refuses. Both run git
twice, and the stat probe runs with the patch-shape flags stripped, so it
succeeds on input the real command rejects -- `git diff -Uabc` exits 129,
`git show -pq` exits 128, and RTK compacted the empty result into a tidy
diffstat and exit 0. The child that runs the user's arguments verbatim is
git's actual verdict on the command, so its failure now propagates with its
stderr. This is also the `run_diff` half of #3843.
`--line-prefix` joins the shapes RTK cannot represent. It prefixes every
output line, the `diff --git` and `@@` markers included, so the compaction
matched nothing and printed a stat header over an empty `Changes:` section.
The attached spelling did this on develop too; the separate spelling only
started once the value was correctly linked to its flag rather than read as
a flag of its own.
grep's `-T`/`--initial-tab` joins them for the same reason: it pads and tabs
every match line, so RTK's forced `-H --null -n` parse read nothing back and
leaked the injected flags, a raw NUL included, into the output. The long
spelling did this on develop; the short one was reachable only once `-T`
stopped being treated as ripgrep's value-taking `--type-not` for grep too.
`checkout -B` claimed the branch name from the arguments *before* reading
what git said, so a created branch lost its `(new)` marker. `-B` creates or
resets and only git knows which, so the arguments are the fallback for when
the English scan misses -- never a short-circuit past it. Reading the glued
`-Bfoo` correctly is what made this reachable; the string scan it replaced
could not see the flag at all.
golangci-lint's value-taking short flags are solo-only. Cobra rejects a
value-taking shorthand inside a cluster ("unknown shorthand flag: 'c' in
-c", 2.13.1), so reading `-Egosec`'s trailing `c` as `--config` swallowed
`run`, and losing the subcommand lost every filter that depends on finding
it. `ValueSpec::solo_only` already expressed exactly this for `git log -n`.
`--results-directory` past the `--` is read per runner mode. In MTP bridge
mode the runner reads its own copy from there and that is where the TRX
lands; in Classic the flag belongs to the test app and dotnet writes to
./TestResults regardless. Reading it as dotnet's own in Classic suppressed
RTK's injection, so the TRX RTK itself asked for by injecting `--logger trx`
was left behind in the user's project, unclaimed and never cleaned up --
measured against a real SDK 9. Both lookups share one scope rule, since
scoping only the presence check would splice the app's path into dotnet's
own arguments; the runner mode is now resolved once instead of per consumer,
which also drops a duplicate filesystem walk.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> N
Nicolas Le Cam committed
b6755bf4a2ca67529416bf531ea84914ab075afa
Parent: 63da972