feat: configurable merge method for /land-and-deploy#726
Open
peterarmstrong wants to merge 1 commit intogarrytan:mainfrom
Open
feat: configurable merge method for /land-and-deploy#726peterarmstrong wants to merge 1 commit intogarrytan:mainfrom
peterarmstrong wants to merge 1 commit intogarrytan:mainfrom
Conversation
388bb97 to
91025de
Compare
Three-tier merge method resolution:
1. User config override (gstack-config set merge_method merge)
2. Auto-detect from GitHub repo settings via API
3. Default to squash (unchanged behavior)
/land-and-deploy now queries the repo's allowed merge methods via
gh api repos/{owner}/{repo}. If only one method is enabled, it uses
that. If multiple are allowed, it picks squash as the default.
Users can override with: gstack-config set merge_method merge
/setup-deploy now persists the merge method to both CLAUDE.md and
gstack-config so /land-and-deploy picks it up automatically.
This fixes the disconnect where the UI said '(from repo settings)'
but nothing actually queried repo settings. The --auto flag still
takes first priority (respects repo settings + merge queues), but
the direct fallback is now configurable instead of hardcoded.
91025de to
6d4c319
Compare
Author
|
@garrytan This is a small vibe-coded thing to be able to change the default squash merge method (so I wouldn't have to fight the default behaviour), and expanded a bit. Please use anything that is helpful, and thanks so much for gstack! |
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
/land-and-deploymerge_methodconfig key togstack-config/setup-deploypersists merge method to both CLAUDE.md and gstack-configProblem
/land-and-deployhardcodesgh pr merge --squash --delete-branchas the fallback when auto-merge is not available. The dry-run UI says "(from repo settings)" but nothing actually queries repo settings. Teams that preserve full commit history can't use/land-and-deploywithout workarounds.Solution: Three-Tier Merge Method Resolution
gstack-config set merge_method merge— explicit overridegh api repos/{owner}/{repo}— if only one merge method is enabled, use it. If multiple allowed, prefer squashsquash(unchanged from current behavior)The
--autoflag still takes first priority (respects repo settings + merge queues). The three-tier logic only applies when auto-merge is not available.Usage
Changes
bin/gstack-configmerge_methodto annotated config header with docsland-and-deploy/SKILL.md.tmplsetup-deploy/SKILL.md.tmpl*/SKILL.mdTest plan
gstack-config set merge_method merge→ uses merge regardless of repo settings/setup-deploywrites merge method to both CLAUDE.md and~/.gstack/config.yaml--autostill takes first priority when available (unchanged)