`gh stack sync` can't be run anywhere in the repository
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 70
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 7
Description
If you're on a repository that uses Stacked PRs, but you're not on a branch that's currently stacked, you see:
```
% gh stack sync
✗ current branch "fix/number" is not part of a stack
Checkout an existing stack using `gh stack checkout` or create a new stack using `gh stack init`
```
This means that if you want to leverage `.git/gh-stack` as the internal state for what branches are available, you need to now go onto a stacked branch to sync.
There should be a way to sync without necessarily being on a stacked branch (for instance, if you want to make sure that your local branch is cleaned up after it's been merged)
Contributor guide
Research direction
Start at the `gh stack sync` command and inspect how it validates the current branch, along with the `.git/gh-stack` state used by stacked repositories. Run the command from a branch that is not part of a stack; done means synchronization can proceed there, including cleanup after a merged local branch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100