gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

worktree: status command

Open schacon opened this issue 1 month ago • 2 comments

if you have active worktrees for applied branches, they should show up in the but status command

❯ but status
╭┄00 [Unassigned Changes]
┊
┊╭┄t6 [user-bookmarks]
┊●   f381269 my commit in my main workdir
┊.
┊├┄nd [wt/user-bookmarks2] {worktree}
┊┊    (.git/gitbutler/worktrees/user-bookmarks2)  
┊●   81269f3 worktree change v2
┊.
┊├┄p3 [wt/user-bookmarks1] {worktree}
┊┊    (.git/gitbutler/worktrees/user-bookmarks1)  
┊●   427019e worktree change ex1
├╯
┊
● 204e309 (common base) [origin/main] Merge pull request #10 from schacon/sc-description

It should be clear that they're associated, but not currently applied here. If files are modified in those directories, they show up as assigned to that worktree.

schacon avatar Nov 07 '25 09:11 schacon

I will be making the worktree information discoverable in our workspace data structure, which then trickles through to the CLI that way. In theory, this makes it usable by the GUI too one day. Note that my implementation will be general without using additional GitButler specific metadata, at least at first.

Byron avatar Nov 07 '25 13:11 Byron

With #11123 there is a basis for bring worktree support closer to the vision presented here.

For now, it looks like this:

Screenshot 2025-11-09 at 10 27 13 Screenshot 2025-11-09 at 10 27 22

It's not meant to satisfy this issue, but a basis for further experimentation, the data is there to do anything really.

Byron avatar Nov 09 '25 09:11 Byron