Repository navigation
fix(hooks): bash-3.2-compatible pre-commit (replace mapfile with read_nul_array) - #23
Conversation
mapfile/readarray are bash 4+ builtins; macOS ships bash 3.2 as /bin/bash, so the hook aborted with 'mapfile: command not found' and every commit needed --no-verify. Replace the three mapfile -d '' calls with a read_nul_array helper (a bash-3.2 'read -r -d ' loop in the current shell via process substitution), preserving NUL-delimited handling of spaces/newlines and the option-injection safety. Verified on /bin/bash 3.2.57. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughThe pre-commit hook replaces ChangesBash 3.2-compatible NUL array population
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
git-hooks/pre-commit used
mapfile -d ''(bash 4+), but macOS default /bin/bash is 3.2 → hook broke, forcing--no-verifycommits. Adds aread_nul_arrayhelper (read -r -d ''loop in the current shell via process substitution) replacing all threemapfilecalls; preserves NUL-delimited handling (spaces/newlines) + option-injection safety.Verification (openclaw agent + CTO review)
Tooling/hook fix (no QGR receipt needed — code-review + clean-run is the gate). Unblocks everyone on bash 3.2 from --no-verify. Authored by openclaw, landed by CTO.
Summary by CodeRabbit