gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

mute and solo modes

Open schacon opened this issue 1 month ago • 2 comments

Let's say we have three branches - one parallel, two stacked:

❯ but st                                                                                                        
╭┄00 [Unassigned Changes]
┊
┊╭┄t6 [sc-branch-29]
┊●   af31a03 worktree change v1
┊│
┊├┄nd [user-bookmarks]
┊●   427019e amaing
├╯
┊
┊╭┄h4 [user-changes]
┊●   3fb0e35 testing commit
├╯
┊
● 204e309 (common base) [origin/main] 2025-07-06 08:10:34 +0200 Merge pull request #10 from schacon/sc-description

Running but solo t6 should temporarily remove h4 so as to "solo" the branch. but solo nd should remove both t6 and h4. Running but status should still show these branches, but greyed out.

Running but mute t6 should do the opposite, only temporarily remove that branch (af31a03 commit) and leave the other work in place. Muting nd may not be possible, because commits above it may be hunk dependent, but if it's possible, it should do it.

Running but unmute should reactivate all muted branches. Or you can reactivate a single one with but unmute [branch]

schacon avatar Nov 07 '25 13:11 schacon

This is exciting!

Just my notes: The new workspace model has a third state for this to indicate the stack is in the workspace, but its tree is not. That way, it's reachable from the workspace merge commit, but we simply don't merge the tree in so it's invisible, yet observable in the commit-graph.

It was meant to be able to allow alternative conflict resolutions, so instead of having to unapply a conflicting branch, we can instead 'ghost' it.

Solo mode would mean that everything but the solo'ed stack is ghosted. Additionally, it would probably be good to keep information about whether it conflicted or not, i.e. it was ghosted because it conflicted with something and thus couldn't really be merged back.

Byron avatar Nov 07 '25 14:11 Byron

I have adjusted the model to capture "muted from a given commit". This allows it to mute/ignore one or more commits from the top of the stack. Useful to 'hide' more recent work and see the worktree from an earlier commit in the stack. It's like partial muting from the top. Based on some Discord message that I can't find right now.

Byron avatar Nov 13 '25 05:11 Byron

cc @jonathantanmy2

krlvi avatar Nov 26 '25 16:11 krlvi

If you implement this, you have the feature: Muting and 'ghosting':

https://github.com/gitbutlerapp/gitbutler/blob/af578999000c60c777dfe0a6b556fbebe8f2a601/crates/but-core/src/ref_metadata.rs#L443-L451

Byron avatar Nov 26 '25 18:11 Byron