98 Commits

Author SHA1 Message Date
Sameen Karim 5bb31d68d0 updated feedback url 2026-04-10 02:03:20 -04:00
Sameen Karim e3db9524eb adressing review comments 2026-04-10 01:11:26 -04:00
Sameen Karim e8344e10ac clear interactive selector on interrupt 2026-04-09 22:51:00 -04:00
Sameen Karim d1acbf0092 remote stack checkout 2026-04-09 21:47:55 -04:00
Sameen Karim dcb5885053 Skip pushing branches with queued PRs
Detect merge queue status via the GitHub GraphQL API's mergeQueueEntry
field and temporarily skip queued branches in push, sync, and submit
commands. Unlike merged state (which is persisted permanently), queued
state is transient — held in-memory only via a json:"-" tagged field
on BranchRef. Each command run re-checks queue status from the API, so
if a PR is ejected from the queue it becomes active again on next run.

Changes:
- Add MergeQueueEntry to PullRequest GraphQL struct and PRDetails
- Add IsQueued()/IsSkipped()/QueuedBranches() to stack model
- Update ActiveBranches() family to exclude queued branches
- Skip queued branches in push, sync (rebase + push), and submit
- Add queued icon, style, and QUEUED state label in TUI view
- Add comprehensive tests for queued state handling

Closes github/pull-requests#24019

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-09 08:24:36 -04:00
Sameen Karim 4b6f2bda82 adressing review comments 2026-04-08 14:10:50 -04:00
Sameen Karim d07c2be3aa support adopting branches with PRs 2026-04-08 12:44:11 -04:00
Sameen Karim 282196289c alias delete 2026-04-08 12:44:11 -04:00
Sameen Karim c56277b68b unstack cmd 2026-04-08 12:44:11 -04:00
Sameen Karim cb7f9fa895 update pr base if not already part of a stack 2026-04-03 11:33:14 -04:00
Sameen Karim bd76d31ef3 early exit if all branches merged 2026-04-03 09:43:47 -04:00
Sameen Karim 9b6b712a54 Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-03 04:32:37 -04:00
Sameen Karim 4604b798c0 rm unstack 2026-04-03 04:15:41 -04:00
Sameen Karim d4967d8d04 submit command 2026-04-03 04:02:59 -04:00
Sameen Karim 891f51f943 add to stack api 2026-04-03 01:54:02 -04:00
Sameen Karim d4adefe238 create stack api 2026-04-03 01:53:29 -04:00
Sameen Karim 6a813d91ef skip unix tests on windows 2026-03-27 03:58:34 -04:00
Sameen Karim 2f228a6d37 command to add alias 2026-03-27 03:39:35 -04:00
Sameen Karim fc4528baa8 protect against time of check vs use race condition 2026-03-26 21:51:44 -04:00
Sameen Karim 629ea06d70 non-blocking saves for non-critical writes 2026-03-25 21:21:26 -04:00
Sameen Karim 37e32a5137 only lock for writes 2026-03-25 20:39:48 -04:00
Sameen Karim 211e563d1f lock failure exit code 2026-03-25 20:06:18 -04:00
Sameen Karim e568d7f005 add file locking to prevent concurrent stack file edits 2026-03-25 19:14:00 -04:00
Sameen Karim 865b4704d7 support custom hostnames for ghes 2026-03-25 17:35:16 -04:00
Sameen Karim 0b9293a4cb disallow prefix or numbered flags with adopt 2026-03-25 16:13:08 -04:00
Sameen Karim 569c63577f assert runInit success 2026-03-25 16:07:56 -04:00
Sameen Karim 3aa8c8eda3 consolidated prefix input and validation 2026-03-25 15:48:32 -04:00
Sameen Karim 103fc37383 fix for initial branch missing prefix 2026-03-25 15:10:00 -04:00
Sameen Karim c26f8b0dfa use correct var in error msg 2026-03-24 23:10:04 -04:00
Sameen Karim b2ba2c224e throw error for non-numeric args 2026-03-24 23:09:24 -04:00
Sameen Karim b53bc7ad69 mock gh api client for tests 2026-03-24 17:54:56 -04:00
Sameen Karim b99f7257e0 set release version via ldflags 2026-03-24 17:29:39 -04:00
Sameen Karim 0869244c12 fix for help output properly showing "gh stack" 2026-03-24 17:08:54 -04:00
Sameen Karim 0c27492b71 more test coverage and clean up 2026-03-24 16:44:35 -04:00
Sameen Karim f03f9f3335 fix: return early from sync on rebase conflict
When a rebase conflict was detected during 'gh stack sync', the function
continued to push branches and reported 'Stack synced' with exit code 0.
Now it persists PR state and returns ErrConflict immediately, preventing
the confusing post-conflict push and success message.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 15:13:13 -04:00
Sameen Karim 30584211db default to named branches, numbering is a flag set on init 2026-03-24 14:00:23 -04:00
Sameen Karim 309e12a8ab skills file for agents 2026-03-24 11:08:35 -04:00
Sameen Karim 1304670224 flag to specify remote and bypass interactive prompt 2026-03-24 01:36:05 -04:00
Sameen Karim d6e6db7a45 json output mode for view 2026-03-24 01:13:10 -04:00
Sameen Karim 260497643a exit codes by error type 2026-03-24 00:38:04 -04:00
Sameen Karim 6e9927d124 rm update pr base logic, should all happen on server 2026-03-23 04:46:55 -04:00
Sameen Karim 1a1f49f2fb exit with nonzero status on error 2026-03-23 04:22:45 -04:00
Sameen Karim 50fdc33683 support commit msg editor, update stage all flag to match git commit, better error handling 2026-03-23 03:54:12 -04:00
Sameen Karim 14364a2408 waterfall pr lookup by url, number, branch name 2026-03-22 21:28:50 -06:00
Sameen Karim 426ad11175 wrap example commands in quotes for non TTY 2026-03-22 20:27:37 -06:00
Sameen Karim 24e18bd088 Handle SIGINT gracefully during interactive prompts
When Ctrl+C is pressed during a prompter interaction, the CLI now prints
a friendly 'Received interrupt, aborting operation' message instead of
ugly wrapped errors like 'failed to read prefix: could not prompt:
interrupt'.

Changes:
- Add isInterruptError(), printInterrupt(), and errInterrupt sentinel
  to cmd/utils.go for centralized interrupt detection
- Update all 8 prompt sites (init, push, checkout, utils) to detect
  survey's terminal.InterruptErr and exit cleanly
- Update callers of resolveStack, pickRemote, and ensureRerere to
  propagate interrupt without double-printing errors
- Change ensureRerere signature to return error so callers can abort
  on interrupt
- Add tests for interrupt detection helpers

Closes td-746bdc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-22 20:26:26 -06:00
Sameen Karim 0a55e35b8b block adopting branches with existing PRs 2026-03-22 17:11:48 -06:00
Sameen Karim 5ea2ec8cb3 clean up chained branches display 2026-03-22 16:45:28 -06:00
Sameen Karim 47d1a3faa2 use full commit sha 2026-03-22 14:20:14 -07:00
Sameen Karim 7144d88d70 politely enable rerere and cache decline 2026-03-22 14:01:16 -07:00