stack sync: optionally rebase stack onto updated base branch
Problem to solve
I am new to the stacking workflow, but using this tool, one thing I found lacking was the ability to rebase the stack when my base branch changed. I find myself wanting the sync command to rebase onto the updated base branch, but I had to run git rebase --update-refs <base-branch> from the last branch in the stack to accomplish this.
Proposal
Add a flag like --update-base (or something better) to glab stack sync that rebases the entire stack onto the current tip of the base branch before performing the existing sync steps. This would be equivalent to
glab stack last && git rebase --update-refs <base-branch> && glab stack sync
Further details
I could see an argument for this proposed behavior being the default behavior for the sync command and then adding a flag instead to skip updating the base branch; either option I think is sufficient. Either way, having this handled within the sync command would be most complete to ensure the stack and all the refs stay up to date when rebasing onto the base branch.