fix: gstack-slug bash compatibility — source to eval#354
Merged
Conversation
Under bash with set -euo pipefail, source <(cmd) process substitution doesn't reliably set variables in the caller's scope. The variables stay empty and -u (nounset) crashes the script. eval "$(cmd)" works correctly in both bash and zsh. Fixes: gstack-review-read, gstack-review-log, gstack-slug comment, gen-skill-docs.ts resolver functions, and regression tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge brought in v0.11.4.0 (Codex in Office Hours). Bumped our bash-compat fix to v0.11.5.0 to avoid version collision. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zehua
added a commit
to zehua/gstack
that referenced
this pull request
Mar 23, 2026
Merges origin/main which includes PR garrytan#354 (eval "$()" fix for bash compat under set -euo pipefail. Resolves conflicts by combining: - Upstream's eval form for all gstack-slug / gstack-diff-scope calls - Our /Users/zehua/.claude-personal dynamic path support - Upstream's {{SLUG_EVAL}}/{{SLUG_SETUP}} template placeholders in .tmpl files All SKILL.md files regenerated. bun test passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> EOF )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gstack-review-readandgstack-review-logcrash withSLUG: unbound variablewhen run under bash withset -euo pipefailsource <(gstack-slug)process substitution doesn't reliably set variables in the caller's scope under bash — variables stay empty, and-u(nounset) kills the scriptsource <(gstack-slug)witheval "$(gstack-slug)"everywhere — works in both bash and zsh.tmpltemplates, thegen-skill-docs.tsgenerator (newSLUG_EVALandSLUG_SETUPresolvers), and regenerated all SKILL.md filessource <(.*gstack-slugpatternsTest Coverage
eval "$(gstack-slug)"sets SLUG and BRANCH underbash -euo pipefail.tmplandgstack-review-*files to preventsource <(.*gstack-slugfrom reappearingPre-Landing Review
No issues found — mechanical text replacement across templates and bin scripts.
Test plan
bash -c 'set -euo pipefail; eval "$(./bin/gstack-slug)"'succeedsgstack-review-readreturns JSONL instead of crashingbun run gen:skill-docsregenerates cleanly🤖 Generated with Claude Code