Skip to content

Keep pre-commit file inventories out of the environment - #254

Merged
dpc merged 1 commit into
rustshop:masterfrom
dpc:dpc/jj-tmkrxutpqpxl
Nov 20, 2026
Merged

dpc merged 1 commit into
rustshop:masterfrom
dpc:dpc/jj-tmkrxutpqpxl

Conversation

@dpc

@dpc dpc commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Posted by Tau

Summary

A clean checkout with 5,201 tracked paths (~210 KB of pathnames) exhausted Linux's per-environment-string limit. The generated pre-commit hook could not start grep, let alone a check. The hook now passes the locations of two private, NUL-delimited lists instead of exporting their contents.

Details

Checks read the inventories while the hook runs and preserve filenames when invoking tools. Typos, ShellCheck and Vale receive bounded batches of arguments. Custom hooks should read FLAKEBOX_GIT_LS_FILE or FLAKEBOX_GIT_LS_TEXT_FILE; flakebox_load_legacy_inventory provides temporary, shell-local compatibility for old Bash hooks. See the migration example in docs/technical-details.md.

This PR targets master independently of #253. When integrating both changes, keep the file-backed inventory and use #253's newline checker with the text inventory as its NUL-delimited stdin; regenerate the hook and Flakebox ID. Neither PR needs the other's commit in its diff.

@dpc
dpc enabled auto-merge (rebase) November 20, 2026 01:57
A clean checkout with 5,201 tracked paths could not start any checks:
the exported path list exceeded Linux's limit on one environment string.
Give each worker two file paths instead. Keep the NUL-delimited records
intact through filtering and bounded tool invocations. Custom checks can
migrate incrementally with a shell-local adapter for the old variables.

Review: Preserve Typos' input spelling so a hidden-path exclusion does
not skip ordinary files. Handle the literal dash via stdin and exercise
both cases in a hidden checkout. Give workers absolute inventory paths
so changing directories does not break a check.


Feed the shared text inventory directly to the batched newline checker.
The rebase review also caught a fixture that assumed every filesystem
accepts invalid UTF-8 filenames. Probe support before testing that case.
@dpc
dpc force-pushed the dpc/jj-tmkrxutpqpxl branch from e3d0549 to 1e5777c Compare November 20, 2026 02:03
@dpc
dpc merged commit 98d2c80 into rustshop:master Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant