Skip to content

Make the pre-push check run on the shell macOS ships - #1388

Merged
EdbertChan merged 1 commit into
mainfrom
stack/EdbertChan/fix/pre-push-bash3-20261012/make-pre-push-check-run-shell-macos-ships--186973c8
Oct 13, 2026
Merged

EdbertChan merged 1 commit into
mainfrom
stack/EdbertChan/fix/pre-push-bash3-20261012/make-pre-push-check-run-shell-macos-ships--186973c8

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Before a push, catstack runs a safety check on the files you changed. On a Mac it crashed, because the built-in shell lacks a feature it used.

So every push from a Mac stopped at the check, even a harmless one.

This change reads the list of changed files with a loop that every shell supports.

The check blocks the same pushes as before. It only stopped crashing.

Review Claim

The push safety check runs on the shell a Mac ships with, and blocks exactly the same pushes as before.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The check still blocks the same pushes, and only the way it reads file lists changes.

Slice Rationale

One small portability fix, kept apart from the rule and hook changes that were blocked by it.

Non-goals

  • No change to which pushes the check allows or blocks.
  • No change to the installer or to any other script.

Measured

Why it crashed, from the default Mac shell and the file at the base commit:

$ /bin/bash --version | head -1
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin26)
$ /bin/bash -c 'mapfile -d "" files </dev/null'
/bin/bash: mapfile: command not found
$ git show origin/main:scripts/git-hooks/pre-push | grep -n mapfile
160:  mapfile -d '' files <"$names"
176:        mapfile -d '' old_files <"$old_names"
185:            mapfile -d '' delta_files <"$delta_names"

Command: python3 -m unittest tests.test_pre_push_hook on a Mac with the default shell

  • base: Ran 27 tests in 15.623s -- FAILED (failures=19)
  • head: Ran 27 tests in 18.762s -- OK

Test Plan

Test Plan
  • python3 -m unittest tests.test_pre_push_hook (head: Ran 27 tests, OK; base: failures=19)
  • python3 engine/skills/make-pr/scripts/preflight.py --base origin/main --commit-only (ok preflight passed)
  • python3 scripts/ci/check_hook_test_coverage.py --base origin/main --head HEAD (OK, 4 hook(s) checked)

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert 680674c3
  • Post-revert steps: Pushes from a Mac stop at the check again until the installed copy is replaced
  • Data migration? No

🤖 Generated with Claude Code

The pre-push review-unit check used a bash 4 builtin that the default macOS
shell (3.2) does not have, so every push from a Mac stopped at the hook. Read
the NUL-separated file lists with a portable loop instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Change-Id: I186973c821653410e5d48a13d1acd2f2e4bb8433
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: ace5f03c-7516-4c7b-b87d-03c5e9c01793)

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 minute 25 seconds in the queue, with no time running CI.

Reason

Pull request #1388 has been merged manually at 12ae673

Hint

You were too fast!

Waiting for
  • check-success = test
  • check-success = validate
All conditions
  • check-success = test
  • check-success = validate
  • check-success = lint

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@mergify mergify Bot added the queued label Oct 13, 2026
@EdbertChan
EdbertChan merged commit 12ae673 into main Oct 13, 2026
8 checks passed
@mergify

mergify Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

queue

☑️ The pull request has been merged manually

Details

The pull request has been merged manually at 12ae673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant