Repository navigation
fix: restore macOS Bash 3.2 compatibility (12106) - #212
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Trust-helper pattern and system-Bash validation lib/commands/init.sh, .github/workflows/lint.yml |
The trust-helper template parenthesizes the birth-time rejection pattern without changing its rejected values. A macOS workflow job checks CLI version commands and generated Bash initialization with system Bash. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: helizaga, natoboram
Merge Risk: 
Minimal · up to 6c322
-
The compatibility fix and targeted macOS checks align with the documented Bash 3.2+ support contract, with no identified merge-blocking risk.
Architecture risk: 
Low · up to 6c322
-
The change affects 1 system.
Changed systems:
libArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — lib (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in lib/commands/init.sh: Added a comment noting the need to balance case patterns inside the substitution for Bash 3.2’s parser.
- observed — Modified behavior in lib/commands/init.sh: Parenthesized the birth-time rejection pattern; the same values remain rejected: empty, zero, zero-prefixed with a period, or containing characters other than digits and periods.
- observed — Modified behavior in .github/workflows/lint.yml: Adds a macOS Bash 3.2 compatibility job that checks out the repository without persisted credentials and runs CLI version checks, Bash initialization generation, syntax validation, and sourcing under the system Bash.
-
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit checked the Bash case,
Then watched the startup run in place.
The shell syntax passed its test,
The CLI woke and did the rest.
Across the Mac, things hopped along.
Comment @coderabbitai help to get the list of available commands.
Pull Request
Description
Restore startup on macOS's system Bash 3.2. The generated trust-helper template contained a
casepattern with an unmatched closing parenthesis inside a heredoc command substitution. Bash 3.2 rejects the source while loading command handlers, so evengit gtr --versionexits with a syntax error.Add the optional opening parenthesis to balance the pattern without changing its matches. Add a macOS CI job that uses system Bash to exercise both CLI entrypoints, generate shell integration, check its syntax, and source it.
Motivation
Tracks issue 12106. Preserve the documented Bash 3.2+ compatibility contract for macOS installations using
/bin/bash.Type of Change
Testing
bats tests/suite: 605/605 passed. Git configuration and Fish config/data/cache directories were isolated under a temporary directory../scripts/generate-completions.sh --checkandgit diff --check: passed./bin/bash -nacross all shipped Bash files: passed.Manual Testing Checklist
Tested on:
Core functionality tested:
git gtr new <branch>git gtr go <branch>git gtr rm <branch>git gtr listinit bash,run,copy, andmvTest Steps
/bin/bash bin/git-gtr --versionon main atf5f3939: it exits 2 with a syntax error atlib/commands/init.sh:189.Expected and actual behavior after the fix: CLI startup and generated Bash integration work with Bash 3.2.
Breaking Changes
Checklist
git gtrand./bin/gtrAdditional Context
The new CI check protects against a real startup failure that Ubuntu's newer Bash does not reproduce. No BATS tests were added or removed; existing trust-helper tests protect the template's behavior.
Agent handoff
Agent Thread Context Handoff
f5f3939fails during command-handler loading under Bash 3.2; Bash 5.3 starts successfully.lib/commands/init.shbalances the template's case pattern;.github/workflows/lint.ymladds a system-Bash macOS smoke job.f5f3939.Quick-start For Next Agent
git status --short --branchin/private/tmp/gtr-bash32-12106-1.lib/commands/init.shand.github/workflows/lint.yml./Users/hleehowon/dev/scratch/codex-pr-monitor/wait-for-pr-review.mjs --repo coderabbitai/git-worktree-runner --pr <this-PR-number>if review is still pending.Continuation Contract
License Acknowledgment
This contribution is made under the Apache License 2.0.
Summary by CodeRabbit