Version
but 0.22.3
Operating System
macOS (Apple Silicon)
Distribution Method
CLI
Describe the issue
I wanted to review the bottom two branches of a four-branch stack on their own, so I hid the top two. but unapply always takes the whole stack, so I ran but unapply <top> and then but apply <second-from-bottom>, which brought back that branch and the one below it. That part works nicely.
The trouble starts when I edit the lower branches while the top ones are hidden. GitButler only rebases applied branches, so the hidden ones keep pointing at the old versions of the lower commits. but apply <top> then applies those stale copies as a parallel stack, so I can't simply reapply, fix and hide again.
How to reproduce
- Create a stack:
a←b←c←d. but unapply d, thenbut apply b(onlyaandbare applied).- Amend or reword a commit in
b. but apply dwould applyd's history, which still contains the oldbcommits, as a separate stack. I didn't run it to avoid the duplicates.
What I did instead
but pick <c and d commits, oldest first> --above b, which created new branches on top of the currentb.- Resolved the conflicts.
- Tried to give the new branches the old names.
but reword <branch> -m <name>refuses ("A branch named '…' exists but is not applied"), andbut branch deletecan't find unapplied branches, so I rangit branch -Don the stale refs and then renamed.
This worked, but it took a native git command, and it's easy to get into this state without noticing. For now I reapply the whole stack before editing anything below a hidden branch.
Questions
- Is there a better CLI path for this? The desktop "stacked apply" (#14919) sounds close, but I couldn't find a CLI equivalent.
- Could
but apply(or a flag) rebase a stale unapplied branch onto the current version of the stack it came from? - Could
but branch deletesupport unapplied local branches? Since #15213 it seems to only see applied ones.
Activity
0No activity yet.