52 Commits

Author SHA1 Message Date
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 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 4604b798c0 rm unstack 2026-04-03 04:15:41 -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 fc4528baa8 protect against time of check vs use race condition 2026-03-26 21:51:44 -04:00
Sameen Karim d5bb33e489 additional lock file test 2026-03-25 21:57:22 -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 d5fcf12415 update gh-stack file schema 2026-03-24 23:08:50 -04:00
Sameen Karim b53bc7ad69 mock gh api client for tests 2026-03-24 17:54:56 -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 6e9927d124 rm update pr base logic, should all happen on server 2026-03-23 04:46:55 -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 5ea2ec8cb3 clean up chained branches display 2026-03-22 16:45:28 -06:00
Sameen Karim 7144d88d70 politely enable rerere and cache decline 2026-03-22 14:01:16 -07:00
Sameen Karim 7bb5ca271c move active branch indices to stack 2026-03-22 09:38:08 -07:00
Sameen Karim e874e26374 push all branches atomically and resolve remotes 2026-03-21 23:35:39 -07:00
Sameen Karim 9d2a7cf8dd use multiline commit msgs for pr body 2026-03-19 12:39:34 -04:00
Sameen Karim f66e95cac9 add sticky header to view tui 2026-03-13 04:40:21 -04:00
Sameen Karim d5903fe4cd hyperlinked PRs in output 2026-03-13 02:30:52 -04:00
Sameen Karim 3a7700e5cb consistent merged check 2026-03-12 22:51:11 -04:00
Sameen Karim 10c3e1b89f update description to reflect base as parent head sha 2026-03-12 21:08:05 -04:00
Sameen Karim 50c8999f78 add basic tests 2026-03-12 19:13:05 -04:00
Sameen Karim c2ddf60fb1 Add testable interfaces for git and github packages
Introduce Ops interface and MockOps for git operations, and ClientOps
interface with MockClient for GitHub API operations. This enables
command-level tests to inject mocks without changing production code.

- git.Ops interface wraps all 34 public git functions
- Package-level functions now delegate through a swappable ops variable
- SetOps()/CurrentOps() allow tests to inject MockOps
- github.ClientOps interface covers all Client methods
- MockClient provides configurable function-field test doubles
- All defaults return zero values; no-op for error returns

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-12 14:02:10 -04:00
Sameen Karim c1aa1f2aad abbreviated workflow to quickly add to stacks 2026-03-12 13:30:06 -04:00
Sameen Karim 07ea259bcb checkout for local stacks 2026-03-12 10:25:42 -04:00
Sameen Karim d5305eb4ba improved handling of merged branches 2026-03-12 09:24:32 -04:00
Sameen Karim b7c15c1da6 interactive terminal ui for view 2026-03-12 01:26:51 -04:00
Sameen Karim 071748c3f4 handle edges cases from review 2026-03-12 01:21:38 -04:00
Sameen Karim b9bfd8644f init as empty slice 2026-03-11 23:23:01 -04:00
Sameen Karim c2a11067c6 show pr status in view 2026-03-11 15:15:16 -04:00
Sameen Karim 5937a75151 addressing review comments 2026-03-11 09:15:55 -04:00
Sameen Karim 03c4b92270 enable git rerere 2026-03-11 01:29:49 -04:00
Sameen Karim f1421adfb4 rebase onto for handling squashed prs 2026-03-11 00:01:14 -04:00
Sameen Karim 2661ee705f sync command to fetch, rebase, and push 2026-03-10 19:24:54 -04:00
Sameen Karim cf62538481 sync state of prs in stack 2026-03-10 19:08:15 -04:00
Sameen Karim 25ff8a15c7 schema for storage format 2026-03-10 17:08:39 -04:00
Sameen Karim fdaa11fba0 updated storage format 2026-03-10 17:06:05 -04:00
Sameen Karim b39609a8d7 disambiguate for multiple stacks 2026-03-10 01:10:28 -04:00
Sameen Karim f3db397593 block init inside an existing stack 2026-03-10 00:07:38 -04:00
Sameen Karim 86d342e88f delete stack locally 2026-03-09 09:51:35 -04:00
Sameen Karim ad9d170f58 push branches and create prs 2026-02-18 04:15:54 -05:00
Sameen Karim cc21c25589 cascading rebase 2026-02-18 03:18:09 -05:00
Sameen Karim 2536e9a5d4 view stack 2026-02-17 19:35:26 -05:00