fix(cli): list the files a glob matches sorted by path #301

Merged
abiwab merged 1 commit from fix/glob-order into main 2026-11-27 15:05:29 +01:00
Owner

resolveGlob returned a glob's matches in the order the crawl met them, which follows the directory's own order and differs from one filesystem to another (hash order on ext4). Every command over **/*.gram (check, build, shop, format, suggest, db sync) therefore listed its files in a machine-dependent order. Found while #300's CI failed on a test that relied on that order.

What changes

  • The matches of each glob are sorted by path, in code-unit order, the same on every machine and locale.
  • A plain path keeps its place among the patterns. A file named twice stays at its first place, as before.
  • Changeset: patch, cli.

Checks

  • bun test: 3959 pass, 1 skip, 0 fail.
  • Typecheck and biome pass.
  • The new tests/glob.test.ts fails without the sort: 40 files written in a scrambled order, and the order of the patterns.
  • glob.ts is identical on dev/1.6, so merging main into dev/1.6 afterwards is clean.
`resolveGlob` returned a glob's matches in the order the crawl met them, which follows the directory's own order and differs from one filesystem to another (hash order on ext4). Every command over `**/*.gram` (`check`, `build`, `shop`, `format`, `suggest`, `db sync`) therefore listed its files in a machine-dependent order. Found while #300's CI failed on a test that relied on that order. ## What changes - The matches of each glob are sorted by path, in code-unit order, the same on every machine and locale. - A plain path keeps its place among the patterns. A file named twice stays at its first place, as before. - Changeset: patch, cli. ## Checks - `bun test`: 3959 pass, 1 skip, 0 fail. - Typecheck and biome pass. - The new `tests/glob.test.ts` fails without the sort: 40 files written in a scrambled order, and the order of the patterns. - `glob.ts` is identical on `dev/1.6`, so merging `main` into `dev/1.6` afterwards is clean.
fix(cli): list the files a glob matches sorted by path
All checks were successful
CI / Build & Test (pull_request) Successful in 5m2s
f9d7ea51f5
abiwab merged commit 537ab84710 into main 2026-11-27 15:05:29 +01:00
abiwab deleted branch fix/glob-order 2026-11-27 15:05:29 +01:00
Sign in to join this conversation.
No description provided.