Repository navigation
Conversation
`jq --indent 0` now pretty-prints with zero-width indentation -- newlines between tokens, no leading spaces -- instead of collapsing to compact output. `-c`/`--compact-output` is the only compact switch. jq 1.7 and earlier let `--indent 0` imply `-c`; jq 1.8 removed that implication (jqlang/jq#3232) and we follow current jq. The differential suite caught it the hard way: `ubuntu-latest` is rolling from 24.04 to 26.04, the two images ship jq 1.7 and jq 1.8, and `diff_indent_0` asserts byte-for-byte parity against whatever `jq` is on PATH. Nightly's `asan` job landed on 26.04 and went red with no change on our side -- and no implementation could satisfy both halves of the fleet. So the oracle is pinned the way ripgrep's already is: `scripts/install-jq-ci.sh` verifies a SHA-256 before the binary reaches PATH and is wired into the three jobs that run these tests (`ci.yml`'s `test` job, `coverage.yml`, nightly's `asan`), with `JQ_VERSION` beside `RG_VERSION`. A pin does not help a developer whose distro ships 1.7, so `assert_matches_from_jq((1, 8), ...)` skips just the affected case on an older host oracle and says why -- the bargain `minimum_bash_major` already strikes for the competitor corpus. Checking the flag combinations turned up a second, pre-existing parity bug: `-c` always won over `--indent N` and `--tab` always won over a later `--indent N`, but real jq -- 1.7 and 1.8 alike -- is strictly last-flag-wins. `jq -c --indent 4` was compact here and indented in real jq. The cause was redundant state: a `compact_output` bool beside an `indent: Indent` whose `Compact` variant already said the same thing, with the tie broken after parsing. One field now holds the output shape and each of the three flags overwrites it, so last-wins falls out of the parse order instead of being arbitrated later. Verified against a digest-checked jq 1.8.1 that `--indent 0` is the only behavior anywhere in the differential suite that 1.7 and 1.8 disagree on, so the precedence cases are asserted unconditionally and only `--indent 0` is gated. `yq` is deliberately untouched: its `-I 0` means compact, which is mikefarah/yq's own documented semantics, not jq's. Claude-Session: https://claude.ai/code/session_01HLxiDLRpTGkSoWxmLkxDeG
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | b01b4a6 | Commit Preview URL Branch Preview URL |
Oct 21 2026, 09:30 AM |
|
Closing this in favour of #2768, which now carries this commit plus the rest of what CI needs. Not abandoned — absorbed. Why it had to move: this branch can't reach green on its own, and neither could #2768. The
That last one was hidden behind this very branch's failure: Two failures on this head are worth recording rather than losing to a close:
The jq work itself is unchanged in #2768: Generated by Claude Code |
What changed
Two output-formatting behaviors now match real jq, and the differential oracle that proves it is pinned.
--indent 0pretty-prints. It emits newlines between tokens with no leading spaces, instead of collapsing to compact output.-c/--compact-outputis now the only compact switch.-c,--taband--indent Nare last-flag-wins. Previously-calways won over--indent N, and--tabalways won over a later--indent N. Real jq — 1.7 and 1.8 alike — takes the last of the three on the command line.scripts/install-jq-ci.shverifies a SHA-256 before the binary reachesPATH, wired into the three jobs that run these tests withJQ_VERSIONbesideRG_VERSION.yqis deliberately untouched — its-I 0means compact, which is mikefarah/yq's own documented semantics, not jq's.Why
Nightly's
asanjob went red onjq::tests::differential::diff_indent_0with no change on our side. The sanitizer was incidental.jq 1.7 and earlier let
--indent 0imply-c; jq 1.8 removed that implication (jqlang/jq#3232).ubuntu-latestis currently rolling from 24.04 to 26.04, and the two images ship jq 1.7 and jq 1.8 respectively — nightly's job landed on 26.04 while PR jobs were still on 24.04. Since the test asserts byte-for-byte parity against whateverjqis onPATH, the suite had become a function of which image a job happened to get, and no implementation could satisfy both halves of the fleet. Pinning the oracle is the actual fix; following jq 1.8 is the right side to pin to, since it is current stable.Checking the flag combinations while fixing that turned up #2 as a pre-existing bug. Its cause was redundant state — a
compact_output: boolsitting beside anindent: IndentwhoseCompactvariant already said the same thing, with the tie broken after parsing. One field now holds the output shape and each of the three flags overwrites it, so last-wins falls out of parse order instead of being arbitrated later.Before / After
Oracle is jq 1.8.1, SHA-256
020468de…c2a0d, matchingscripts/install-jq-ci.sh.echo '{"a":[1,2]}' | jq <flags> .--indent 0{"a":[1,2]}{⏎"a": [⏎1,⏎2⏎]⏎}-c --indent 0{"a":[1,2]}{⏎"a": [⏎1,⏎2⏎]⏎}--indent 0 -c{"a":[1,2]}{"a":[1,2]}-c --indent 4{"a":[1,2]}--indent 4 -c{"a":[1,2]}{"a":[1,2]}-c --tab{"a":[1,2]}--tab --indent 4The failing nightly assertion, before:
I also replayed every case in the differential suite against both jq 1.7 and jq 1.8.1 to size the blast radius.
--indent 0is the only behavior the two versions disagree on anywhere:That is why the precedence cases are asserted unconditionally and only
--indent 0is gated.Risk
--indent 0and the-c/--indent/--tabcombinations change output shape, so a caller that relied on--indent 0meaning compact gets pretty output — exactly as it would from a real jq 1.8 upgrade.-calone,--indent Nalone and--tabalone are unchanged, and those are the forms every jq spec case in the repo uses.assert_matches_from_jq((1, 8), …)skips just the affected case on an older host oracle and prints why — the bargainminimum_bash_majoralready strikes for the competitor corpus. The gate is per-case, never suite-wide: a skipped suite is indistinguishable from a passing one.Checklist
--indent 0flat + nested,-cstill compact, the full last-wins matrix as both unit and differential tests, and a regression test for--tabfollowed by--indent NGenerated by Claude Code