fix: fall back to dirname/unknown when git context is absent#564
Open
collinstraka-clov wants to merge 1 commit intogarrytan:mainfrom
Open
fix: fall back to dirname/unknown when git context is absent#564collinstraka-clov wants to merge 1 commit intogarrytan:mainfrom
collinstraka-clov wants to merge 1 commit intogarrytan:mainfrom
Conversation
gstack-review-log uses set -euo pipefail, which treats empty strings as unbound variables. When run outside a git repo (or in a repo with no remote), gstack-slug produced empty SLUG and BRANCH, causing: gstack-review-log: line 8: SLUG: unbound variable gstack-review-log: line 9: BRANCH: unbound variable Fix: add || true to prevent set -e from aborting on git failures, then fall back to the current directory name for SLUG and "unknown" for BRANCH. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
gstack-review-logusesset -euo pipefail, which treats empty strings as unbound variables. When run outside a git repo (or in a repo with no remote configured),gstack-slugproduces empty strings forSLUGandBRANCH, causing:This breaks any gstack review skill (e.g.
/autoplan,/plan-ceo-review) when the working directory isn't a git repo with a remote.Fix
Two changes in
gstack-slug:|| trueto the git commands soset -edoesn't abort when git context is missingbasename "$PWD"forSLUGand"unknown"forBRANCHwhen the values are emptyRepro
Run any gstack review skill in a directory with no git remote configured.
🤖 Generated with Claude Code