Skip to content
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0baf07e
fix(git): pass patch logs through unchanged
kingpy-bot Jul 11, 2026
ed3645c
fix(discover): sanitize drive-letter colon so Windows discover finds …
zbl1998-sdjn Jul 11, 2026
a3ba3c5
fix(stream): decode lossily instead of dropping lines on invalid UTF-8
albatrossflyon-coder Jul 14, 2026
fd2f942
fix(tee): hash long recovery-file slugs to prevent collisions and sho…
breisnerlopez Jul 19, 2026
ae5d1ae
fix(stream): address review feedback on read_lines_lossy
albatrossflyon-coder Aug 11, 2026
1989899
Merge pull request #2997 from albatrossflyon-coder/fix/utf8-line-drop…
KuSh Aug 12, 2026
40fccbd
test(discover): remove duplicated test
KuSh Aug 12, 2026
6f0b0ca
Merge pull request #2952 from zbl1998-sdjn/fix/discover-windows-drive…
KuSh Aug 13, 2026
5bd410e
fix(core): decode process output using Windows console code page
guyoron1 Jun 29, 2026
945c3a5
fix(core): use windows-sys crate for code page detection, fix CI test
guyoron1 Jun 29, 2026
de38f44
style: expand unsafe block to satisfy rustfmt
guyoron1 Jun 29, 2026
b35ff3a
fix(core): route all child-process output decoding through decode_pro…
guyoron1 Aug 14, 2026
40e4f3a
fix(git): respect -- pathspec separator in git log patch detection
KuSh Aug 14, 2026
d977e1c
Merge pull request #2951 from kingpy-bot/fix/git-log-patch-passthroug…
KuSh Aug 14, 2026
3cc80b2
fix(git): don't misdetect a value-taking option's argument as a patch…
KuSh Aug 15, 2026
f496f59
fix(core): decode per line, cover OEM code pages, and centralize on e…
guyoron1 Aug 15, 2026
32dc612
fix(core): keep the signal diagnostic when capturing child output
guyoron1 Aug 16, 2026
668f449
fix(test): insulate rewrite tests from the machine's permission settings
guyoron1 Aug 16, 2026
57872f8
Merge pull request #2717 from guyoron1/fix/windows-gbk-encoding
KuSh Aug 16, 2026
48638d6
refactor(test): drop eval helper, regroup verdict-mapping tests
KuSh Aug 16, 2026
32c83cc
Merge pull request #3147 from guyoron1/fix/rewrite-test-env-sensitivity
KuSh Aug 16, 2026
4947eda
fix(benchmark): avoid negative cargo and curl cases
ousamabenyounes Jul 21, 2026
497ef8b
test(cargo): share tiny build output fixture
ousamabenyounes Aug 13, 2026
4644fa8
fix(benchmark): serve curl/wget fixtures from loopback, drop mockhttp…
ousamabenyounes Aug 15, 2026
13bd8f2
fix(cargo): apply never-worse guard to test summary
ousamabenyounes Aug 15, 2026
7f6156f
fix(cicd): make benchmark loopback server port-agnostic and cleanup s…
ousamabenyounes Aug 17, 2026
d003920
refactor(cargo): extract compute_test_summary and cover the never-wor…
ousamabenyounes Aug 17, 2026
ba7a9ce
Merge pull request #3430 from ousamabenyounes/fix/benchmark-negative-…
KuSh Aug 17, 2026
962554d
fix(cicd): stop benchmark.sh deleting the tracked scripts/benchmark h…
ousamabenyounes Aug 17, 2026
9ee1532
refactor(tee): simplify short_hash and correct its collision framing
breisnerlopez Aug 17, 2026
e5cecd3
fix(find): apply never-worse guard against the capped listing
aeppling Aug 19, 2026
d5a1ddc
feat(find): tee tail hint when rtk imposes the result cap
aeppling Aug 19, 2026
6370e79
fix(find): passthrough to real find on unsupported flags
aeppling Aug 19, 2026
705a2f8
fix(git): -U, --unified, --expand-tabs don't take a separate-token value
KuSh Aug 19, 2026
1a1b306
fix(git): --max-parents/--min-parents also only take an attached value
KuSh Aug 19, 2026
84169e2
fix(git): add --diff-algorithm/--diff-filter to value-consuming options
KuSh Aug 19, 2026
9bbf55c
fix(git): value/limit/format detection for git log misdetects --grep …
KuSh Aug 19, 2026
ca89767
fix(git): git log --stat/--numstat/etc. weren't requesting raw passth…
KuSh Aug 19, 2026
983d0c9
Merge pull request #3266 from breisnerlopez/fix/tee-recovery-slug-col…
KuSh Aug 20, 2026
3034b39
Merge pull request #3595 from ousamabenyounes/fix/benchmark-dir-wipes…
KuSh Aug 20, 2026
f8d636d
fix(git): restore -- before requests_raw_log_output in run_log
KuSh Aug 20, 2026
29f9bb7
Merge pull request #3575 from rtk-ai/fix/git-log-grep-value-misdetect…
KuSh Aug 20, 2026
35db3e1
fix(find): track passthrough runs as 0/0 like search.rs
aeppling Aug 25, 2026
7d4057e
fix(find): tee in display order so the tail hint returns hidden files
aeppling Aug 25, 2026
8942e75
fix(find): exec_capture to exec_capture_stdin
aeppling Aug 25, 2026
0793198
fix(find): forward passthrough output as raw bytes
aeppling Aug 26, 2026
5d697b0
feat(find): dispatch on find's grammar; compress find output for unmo…
aeppling Aug 26, 2026
d3f31dd
fix(find): parse less — rtk flags only in the native subset, find opt…
aeppling Aug 26, 2026
10b1a09
test(find): use TempDir for the unicode dir fixture
aeppling Aug 26, 2026
f614c3c
fix(find): use the house helpers; honor trailing rtk flags; never blo…
aeppling Aug 26, 2026
989f453
fix(find): keep the hint under the guard; let find refuse rtk flags b…
aeppling Aug 26, 2026
e269b40
fix(find): print directory labels in full
aeppling Aug 26, 2026
988f2e3
fix(find): keep root-relative output and legacy name syntax
aeppling Aug 26, 2026
203948b
Merge pull request #3603 from rtk-ai/fix/find-never-worse
aeppling Aug 26, 2026
b168be2
test(find): use the platform temp dir instead of /tmp
aeppling Aug 26, 2026
81754bf
Merge pull request #3717 from rtk-ai/fix/find-windows-test
aeppling Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 56 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ categories = ["command-line-utilities", "development-tools"]
[dependencies]
clap = { version = "4", features = ["derive"] }
anyhow = "1.0"
# Console code page decoding for child-process output. Kept off the
# cfg(windows) target so the mapping and the incremental UTF-8 walk stay
# compiled — and unit-tested — on every platform; only the code page *lookup*
# is Windows-specific. codepage covers the ANSI/DBCS pages encoding_rs
# implements, oem_cp the legacy OEM/DOS pages (437, 850, …) it does not.
encoding_rs = "0.8"
codepage = "0.1"
oem_cp = "2"
ignore = "0.4"
walkdir = "2"
regex = "1"
Expand All @@ -37,6 +45,12 @@ automod = "1"
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = [
"Win32_System_Console",
"Win32_Globalization",
] }

[build-dependencies]
toml = "0.8"

Expand Down
105 changes: 94 additions & 11 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ fi
BENCH_DIR="$(pwd)/scripts/benchmark"
RTK_ROOT="$(pwd)"

# Only the gitignored output subdirectories get wiped between local runs.
# `$BENCH_DIR` itself is tracked — it also holds the TypeScript VM-benchmark
# harness (run.ts, cleanup.ts, lib/) — so `rm -rf "$BENCH_DIR"` deleted that
# harness from the working tree on every local run.
if [ -z "$CI" ]; then
rm -rf "$BENCH_DIR"
mkdir -p "$BENCH_DIR/unix" "$BENCH_DIR/rtk" "$BENCH_DIR/diff"
for bench_output_dir in unix rtk diff; do
rm -rf "${BENCH_DIR:?}/$bench_output_dir"
mkdir -p "$BENCH_DIR/$bench_output_dir"
done
fi

safe_name() {
Expand Down Expand Up @@ -342,21 +348,98 @@ section "wc"
bench "wc" "wc Cargo.toml src/main.rs" "$RTK wc Cargo.toml src/main.rs"

# ===================
# curl
# ===================
# curl / wget — fully offline. mockhttp.org was both a network dependency and
# non-deterministic (its /json output is random), which made the benchmark flaky.
# Serve fixed fixtures locally instead. The JSON is pretty-printed on purpose so
# `rtk` actually exercises JSON minification (a pre-minified body leaves nothing
# to compact).
# ===================
NET_FIXTURE_DIR="$(mktemp -d)"
# Server log lives outside the served directory so it is never itself served.
NET_HTTP_LOG="$(mktemp)"
NET_HTTP_PID=""
# Every step is failure-tolerant: this runs from an EXIT trap under `set -e`, so
# a single failing command (e.g. `kill` on a server that already died) would
# otherwise abort the trap and leak the fixture dir and downloaded files.
cleanup_net_fixtures() {
if [ -n "$NET_HTTP_PID" ]; then
kill "$NET_HTTP_PID" 2>/dev/null || true
fi
rm -rf "$NET_FIXTURE_DIR" "$NET_HTTP_LOG" || true
# `rtk wget <url>/data.json` saves to ./data.json (default basename); remove
# that download and any numbered duplicates from repeated runs.
rm -f data.json data.json.* 2>/dev/null || true
}
trap cleanup_net_fixtures EXIT

cat > "$NET_FIXTURE_DIR/data.json" << 'JSONEOF'
{
"message": "Hello from RTK benchmark",
"status": "success",
"code": 200,
"items": [
{ "id": 1, "name": "first" },
{ "id": 2, "name": "second" }
]
}
JSONEOF
cat > "$NET_FIXTURE_DIR/robots.txt" << 'TXTEOF'
User-agent: *
Disallow: /private/
Allow: /
Sitemap: https://example.com/sitemap.xml
TXTEOF

# Bring up a loopback HTTP server once so both curl and wget get real response
# headers (`Content-Type: application/json`) — that's what lets rtk detect JSON
# and minify it. file:// carries no headers, so it can't demonstrate that path.
#
# Port 0 asks the kernel for a free port, so a busy fixed port can never make the
# benchmark fail. `python3 -u` keeps stdout unbuffered, so the "Serving HTTP on
# 127.0.0.1 port NNNNN" line — printed only once the socket is bound and
# listening — reaches the log as soon as the server is ready.
readonly NET_HTTP_EPHEMERAL_PORT=0
readonly NET_HTTP_READY_ATTEMPTS=25
readonly NET_HTTP_READY_DELAY=0.2
NET_HTTP_URL=""
if command -v python3 &> /dev/null; then
( cd "$NET_FIXTURE_DIR" \
&& exec python3 -u -m http.server "$NET_HTTP_EPHEMERAL_PORT" --bind 127.0.0.1 ) \
> "$NET_HTTP_LOG" 2>&1 &
NET_HTTP_PID=$!
for _ in $(seq 1 "$NET_HTTP_READY_ATTEMPTS"); do
net_http_port="$(sed -n 's/.*port \([0-9][0-9]*\).*/\1/p' "$NET_HTTP_LOG" | head -1)"
if [ -n "$net_http_port" ]; then
NET_HTTP_URL="http://127.0.0.1:$net_http_port"
break
fi
sleep "$NET_HTTP_READY_DELAY"
done
fi

section "curl"
if command -v curl &> /dev/null; then
bench "curl json" "curl -s https://mockhttp.org/json/1" "$RTK curl https://mockhttp.org/json/1"
bench "curl text" "curl -s https://mockhttp.org/robots.txt" "$RTK curl https://mockhttp.org/robots.txt"
if [ -n "$NET_HTTP_URL" ]; then
bench "curl json" "curl -s $NET_HTTP_URL/data.json" "$RTK curl $NET_HTTP_URL/data.json"
bench "curl text" "curl -s $NET_HTTP_URL/robots.txt" "$RTK curl $NET_HTTP_URL/robots.txt"
else
# No python3 to host a local server — fall back to file:// (no headers, so
# no JSON minification, but still fully offline and deterministic).
bench "curl json" "curl -s file://$NET_FIXTURE_DIR/data.json" "$RTK curl file://$NET_FIXTURE_DIR/data.json"
bench "curl text" "curl -s file://$NET_FIXTURE_DIR/robots.txt" "$RTK curl file://$NET_FIXTURE_DIR/robots.txt"
fi
fi

# ===================
# wget
# ===================
# wget has no offline fallback: it rejects file:// outright ("Unsupported
# scheme"), so without the loopback server there is nothing local to fetch. Say
# so explicitly instead of letting the case disappear from the report.
if command -v wget &> /dev/null; then
section "wget"
bench "wget" "wget -qO- https://mockhttp.org/json/1" "$RTK wget https://mockhttp.org/json/1"
rm -f 1 2>/dev/null
if [ -n "$NET_HTTP_URL" ]; then
bench "wget" "wget -qO- $NET_HTTP_URL/data.json" "$RTK wget $NET_HTTP_URL/data.json"
else
echo "⏭️ wget (no local HTTP server available, skipped)"
fi
fi

# ===================
Expand Down
Loading
Loading