fix: handle existing PRs in st submit gracefully#44
Merged
Conversation
Add a new git helper that lists PRs for a specific branch head without the --author @me filter, allowing discovery of PRs created by other authors or bots. Also remove silent mode from ghPrCreate so failures are thrown instead of returning null. Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com mailto:noreply@anthropic.com
Previously, if a PR already existed but wasn't returned by ghPrList (--author @me filter), ghPrCreate would silently fail and return null, skipping force push for the entire stack. Now: • Wrap PR creation in try/catch with fallback to ghPrListForBranch • Supplement freshPrs with PRs from other authors for tracked branches so the stack tree is complete and force push works Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com mailto: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.
Summary
ghPrCreate에서silent: true제거하여 PR 생성 실패 시 에러가 보이도록 수정ghPrListForBranch로 기존 PR 존재 여부를 확인하는 fallback 추가freshPrs빌드 시--author @me필터에 빠진 tracked 브랜치의 PR을 보충하여 스택 트리가 완전하게 구성되도록 수정 → force push 정상 동작Problem
st submit에서 이미 PR이 있는 브랜치에 대해:ghPrList의--author @me필터로 인해 다른 방식으로 생성된 PR을 감지하지 못함ghPrCreate가silent: true로 실행되어 실패 시null반환 →Created: null출력Test plan
st submit실행 → 정상 push 확인st submit실행 → PR 생성 정상 동작 확인--dry-run플래그 동작 확인🤖 Generated with Claude Code