Commit Graph

34 Commits

Author SHA1 Message Date
Sameen Karim d3be1b577e prune merged branches (#94)
* prune merged branches

* interactively prompt for prune

* delete remote tracking ref too

* disable selecting merged branches in TUIs

* include full list (including merged PRs) in PUT request to stacks API

* add prune to docs

* addressing review comments

* increment skill file version
v0.0.4
2026-05-15 14:01:04 -04:00
Sameen Karim 650a94621d docs on rebase workflow (#93)
* docs on rebase workflow

* highlight commit signing callout
2026-05-15 14:01:04 -04:00
Sameen Karim d115ca0570 support multiple branches during init (#91)
* implicitly adopt branches in init

* deprecate adopt flag

* update docs

* address review comments
2026-05-15 14:01:03 -04:00
Sameen Karim 00a9589feb rm merge command (#89) 2026-05-15 14:01:03 -04:00
Sameen Karim 8a9f1c86f8 commands help text (#88)
* more help text for commands

* improved root help

* fix typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* updated examples for add cmd

Co-authored-by: Sameen Karim <skarim@github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 14:01:02 -04:00
dependabot[bot] d159b80057 Bump devalue in /docs in the npm_and_yarn group across 1 directory (#90)
Bumps the npm_and_yarn group with 1 update in the /docs directory: [devalue](https://github.com/sveltejs/devalue).


Updates `devalue` from 5.6.4 to 5.8.1
- [Release notes](https://github.com/sveltejs/devalue/releases)
- [Changelog](https://github.com/sveltejs/devalue/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/devalue/compare/v5.6.4...v5.8.1)

---
updated-dependencies:
- dependency-name: devalue
  dependency-version: 5.8.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-14 18:54:24 -04:00
dependabot[bot] 05de7e19b3 Bump astro in /docs in the npm_and_yarn group across 1 directory (#86)
Bumps the npm_and_yarn group with 1 update in the /docs directory: [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro).


Updates `astro` from 6.1.8 to 6.3.1
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@6.3.1/packages/astro)

---
updated-dependencies:
- dependency-name: astro
  dependency-version: 6.3.1
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-14 17:24:06 -04:00
Sameen Karim 8dbd7c63ed improve agent friendliness of view --json (#80)
* return exit codes instead of interactive prompt for view json mode

* increment skill file version
v0.0.3
2026-05-11 11:09:33 -04:00
Sameen Karim 8cddfd4e21 Optimize view/modify TUI load time with parallel fetching (#79)
- Deduplicate API calls: syncStackPRs now returns PRDetails for
  LoadBranchNodes to reuse, eliminating redundant FindPRDetailsForBranch calls
- Parallelize API calls in syncStackPRs (capped at 6 concurrent requests)
- Parallelize git operations in LoadBranchNodes (capped at 4 concurrent)
- Show "Loading stack..." indicator for interactive sessions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 11:09:32 -04:00
Sameen Karim 9d2c44263f Remove unused GraphQL fields to reduce API rate limit consumption (#78)
Audit all 7 GraphQL operations and remove fields that are fetched but
never used in Go code:

- Remove FindAnyPRForBranch: entire function is dead code (zero call sites)
- FindPRForBranch: remove title, state, headRefName, merged (4 fields)
- CreatePR: remove title, state, headRefName, baseRefName, isDraft (5 fields)
- FindPRDetailsForBranch: remove id, title, headRefName, baseRefName,
  comments { totalCount } (4 fields + 1 nested object)
- FindPRByNumber: remove title (1 field)

Also remove Title from PullRequest struct, and Title + CommentsCount
from PRDetails struct since they are no longer populated or read.

Total: ~15 unused fields removed across 5 queries, 1 dead query deleted,
and 1 unnecessary nested object (comments) eliminated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 11:09:31 -04:00
Sameen Karim b71b10c268 use PR template when opening PRs (#77)
* use pr template when opening prs

* add a helper to clearly distinguish between filesystem errors and actual test failures
2026-05-11 11:09:31 -04:00
Sameen Karim 13330406ef open PRs as draft by default (#76)
* open prs as draft by default

* apply suggested docs updates from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-11 11:09:30 -04:00
Sameen Karim d1e9d14136 run fetch before push operations (#75)
* run fetch before push operations

* ignore if ref doesn't exist on remote

* rm fetch from link

* more durable fetch by trying all first and falling back to individual fetches

* run fetch before sync
2026-05-11 11:09:30 -04:00
Sameen Karim 03fe8ea371 simplify unstack to only target the active stack (#74)
* rm arg from unstack so it only targets active stack

* fix typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-11 11:09:29 -04:00
Sameen Karim 3700f4ec8c docs content updates (#83)
* update faq content

* clarify auth requirement for cli

* docs on rebase stack button behavior

* update header level

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* clarify TUI acronym

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-07 10:10:17 -04:00
dependabot[bot] de00856fde Bump postcss in /docs in the npm_and_yarn group across 1 directory (#73)
Bumps the npm_and_yarn group with 1 update in the /docs directory: [postcss](https://github.com/postcss/postcss).


Updates `postcss` from 8.5.8 to 8.5.14
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.8...8.5.14)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.14
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-04 23:19:58 -04:00
Sameen Karim 7a268fc380 modify command (#72)
* git primitives for modify cmd

* extract reusable TUI parts

* modify cmd

* recreate stack after modify

* add checks to prevent other modifications while modify is applying

* modify continue for resuming after resolving conflicts

* fix bug with duplicate stack entries after modifying

* reuse conflict resolution help msg from rebase

* additional confirmation before overwriting stack on remote

* fix recreate order of operations

Co-authored-by: Copilot <copilot@github.com>

* move base commit instead of cherry picking for fold up

* check to ensure we aren't left with zero branches

* unify and dedupe across view and modify tui

* more detailed help instructions

Co-authored-by: Copilot <copilot@github.com>

* only recommend submit if stack exists on remote

Co-authored-by: Copilot <copilot@github.com>

* tests for modify tui, apply modifications, submit modifications

* refactor submit for regular and pending modifications

* rename recover to abort

Co-authored-by: Copilot <copilot@github.com>

* docs for modify cmd

* tui styling updates

* updated tui screenshot

* addressing review comments

* Fix 4 bugs from code review

Bug 1: Move RevParseMap error check before using originalRefs.
The error from git.RevParseMap() was deferred past iteration of
originalRefs, which could panic on a nil map.

Bug 2: Differentiate cherry-pick vs rebase conflicts in modify.
Cherry-pick conflicts don't save state as 'conflict' phase, so
--continue won't work. Now prints --abort-only instructions for
cherry-pick conflicts.

Bug 3: Unwind now cleans up branches created by renames.
After restoring snapshot branches, Unwind deletes renamed branch
names that don't belong to the original snapshot.

Bug 4: Simplify push message in submit command.
Changed from 'Pushing N branches to remote...' to 'Pushing to
remote...' since individual branches may fail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix 7 nit issues from code review

11: Add named constants for phase strings (PhaseApplying, PhaseConflict,
PhasePendingSubmit) in state.go; replace remaining raw literals in
state.go CheckStateGuard.

14: Fix bottomLines comment mismatch — listed 3 items but value is 2.

15: Extract magic number 88 to MinWidthForArt constant in header.go.

16: Remove unused stackview import anchor in model.go — the import
is used via types.go where BranchNode is embedded.

17: Simplify CheckStackLinearity parent resolution — ActiveBaseBranch
already handles skipping merged branches.

18: Fix rename undo matching any rename — add NewName check so only
the specific rename being undone is matched.

20: Add TestUndoRename and TestUndoRename_DoesNotAffectOtherRenames
to validate rename undo behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make cherry-pick conflicts recoverable via --continue

Previously, cherry-pick conflicts during fold-down operations could only
be resolved with --abort. Now they save full conflict state (phase,
conflict type, fold branch/target, remaining branches) to the state file,
enabling recovery via 'gh stack modify --continue'.

Changes:
- Add ConflictType field to StateFile (rebase or cherry_pick)
- Add FoldBranch/FoldTarget fields for cherry-pick context
- Add CherryPickContinue to git package (cherry-pick --continue)
- Save cherry-pick conflict state in ApplyPlan with remaining branches
- ContinueApply handles both rebase and cherry-pick conflicts
- Unified conflict messaging in cmd/modify.go (both types show --continue)
- Updated test to verify cherry-pick conflict state is saved correctly

* Apply suggestions from code review

Co-authored-by: Luke Ghenco <lukeghenco@github.com>
Co-authored-by: Sameen Karim <skarim@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Luke Ghenco <lukeghenco@github.com>
2026-05-04 22:34:42 -04:00
Copilot ad56830859 docs: stack object in pull_request webhooks (#67)
* Initial plan

* Add CI integration guide documenting stack object in pull_request webhook events

Agent-Logs-Url: https://github.com/github/gh-stack/sessions/cf10db22-af0b-45c3-95d6-de9ef313d624

Co-authored-by: willsmythe <2503052+willsmythe@users.noreply.github.com>

* clean up webhooks content

* improve workflow code sample

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: willsmythe <2503052+willsmythe@users.noreply.github.com>
Co-authored-by: Sameen Karim <skarim@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-04 01:14:32 -04:00
Copilot ad21053fe9 Guard GraphQL PR number conversion against int32 overflow (#56)
* Initial plan

* fix: validate int range before GraphQL Int conversion

Agent-Logs-Url: https://github.com/github/gh-stack/sessions/dbb2b50f-34fb-4957-ac08-e19c1f96ba41

Co-authored-by: skarim <1701557+skarim@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: skarim <1701557+skarim@users.noreply.github.com>
2026-04-23 12:21:43 -04:00
dependabot[bot] a853a21e35 Bump astro in /docs in the npm_and_yarn group across 1 directory (#60)
Bumps the npm_and_yarn group with 1 update in the /docs directory: [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro).


Updates `astro` from 6.0.8 to 6.1.8
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@6.1.8/packages/astro)

---
updated-dependencies:
- dependency-name: astro
  dependency-version: 6.1.8
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-21 22:08:46 -04:00
Sameen Karim 7af17b55dc switch command (#51)
* switch cmd to interactively switch to another branch in the stack

* add switch to docs

* addressing review comments

* bump skill file version

* default to current branch
v0.0.2
2026-04-20 11:20:27 -04:00
Sameen Karim a00ff54996 link command for api-only operations (#50)
* link cmd for api-only stack upserts

* accept branch names too

* push branches first

* update docs with link cmd details

* adding more logging
2026-04-20 11:19:01 -04:00
Sameen Karim 42e43a47ae ignore stale merged/closed PRs for reused branch names (#49)
* ignore stale merged/closed PRs for reused branch names

* guard for edge case of deleted PR
2026-04-20 11:18:19 -04:00
Sameen Karim 8893d274f2 preflight check for stacked PR availability in submit (#44)
* preflight check for stacked prs before submit

* close pipe read end in test to avoid FD leak

* concise var reuse
2026-04-20 11:17:20 -04:00
Sameen Karim 8aba9802c8 minor docs styling & content updates (#48)
* udpate meta tags for docs site

* stack diagram styling fixes

* update favicon

* recommend gh skill to install skills file
2026-04-20 11:16:14 -04:00
Sameen Karim f706944b63 fix --onto rebase for merged branches (#43)
* backfill ontoOldBase for deleted merged branches

* ensure upstack rebase checks immediate predecessor

* fix for stale ontoOldBase causing rebase conflicts
2026-04-20 11:15:32 -04:00
Sameen Karim 22c8ef460b fix for rev-parse error during sync with deleted branches (#42)
* fix for rev-parse error during sync

* clearer info msg with rebasing over merged PRs
2026-04-20 11:14:50 -04:00
Sameen Karim b038eedcb4 fix for rev-parse error when rebasing over deleted branches (#41)
* fix for rev-parse error when rebasing over deleted branches
2026-04-20 11:11:28 -04:00
Sameen Karim 766d0e2ab9 fast forward active branches where local is behind remote (#40)
* fast forward active branches where local is behind remote
2026-04-20 11:10:55 -04:00
Sameen Karim 72b4dc563c fix for inflated diff counts when base branch has been updated since stack init (#39)
* fix for inflated diff counts when base branch has been updated since stack init
2026-04-20 11:09:45 -04:00
Sameen Karim 5c1fe16868 docs site content updates (#28)
* additional private preview callouts

* squash merge clarification

* home page updates

* merge process clarification
2026-04-14 15:17:23 -04:00
Sameen Karim c80e10c9c5 docs site styling (#20)
* docs site styling

* nav styling

* tidying up some small styles

* mobile nav styling

---------

Co-authored-by: Dean <deanblacc@github.com>
2026-04-14 13:39:03 -04:00
Sameen Karim e06284ff5c skip pulling merged branches during remote checkout (#16)
* skip pulling merged branches during remote checkout

* show message if stack fully merged
2026-04-13 18:36:35 -04:00
Sameen Karim b01754e4a9 Initial release v0.0.1 2026-04-10 03:32:08 -04:00