gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

`gh stack sync` should tell you what branches it wants to prune on your behalf

Open DavisVaughan opened this issue 4 months ago • 1 comments

Here's a state where I just used gh stack sync after manually merging PR 2 in a stack of 7 PRs.

Image

Everything looks good, except Prune 1 merged branch is a bit unclear.

I've already run gh stack sync after merging PR 1 too, so the branch for PR 1, feature/sources-1-oak-cache is already gone.

So the 1 branch to prune must be referring to feature/sources-2-oak-source, which makes sense, but it requires me to kind of interpret between the lines here.

It would be a bit more obvious (and safer?) if Prune 1 merged branch just listed the names of the branches it wants to prune somewhere. You see them after you say Y, but that's a bit too late 😬

Image

DavisVaughan avatar Jul 02 '26 19:07 DavisVaughan

Yeah I'd imagine this would be a better affordance:

The following merged branches will be pruned locally and remotely:
  - feature/sources-2-oak-source
  - feature/sources-3-oak-source

? Prune 1 merged branch? (Y/n)

Edit: couldn't open a PR, however I implemented this in my fork: https://github.com/servusdei2018/gh-stack/commit/050ac5f0768bf6605e5151c9cf261c62ded951ad

servusdei2018 avatar Jul 06 '26 02:07 servusdei2018