Skip to content

fix(ci): use portable fallbacks for bash-4 builtins and GNU sed in hook scripts#3694

Open
jiengup wants to merge 1 commit into
apache:masterfrom
jiengup:ci-mapfile
Open

fix(ci): use portable fallbacks for bash-4 builtins and GNU sed in hook scripts#3694
jiengup wants to merge 1 commit into
apache:masterfrom
jiengup:ci-mapfile

Conversation

@jiengup

@jiengup jiengup commented Jul 17, 2026

Copy link
Copy Markdown

Closes #3693

Rationale

Several hook scripts use mapfile (bash >= 4) and sed -i without backup extension (GNU extension). On macOS stock bash 3.2 and BSD sed, these fail, blocking contributors from committing.

What changed

  • mapfile calls now guard with command -v mapfile and fall back to a while IFS= read -r loop.
  • sed -i calls is replaced by the sed -i.bak && rm pattern already established in trailing-whitespace.sh.

Local Execution

  • prek run -a

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pre-commit hooks use bash-isms that block contributors on other shell (e.g, zsh)

1 participant