You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[idea] Expose branch and ahead/behind in the workspace API
#5372
herdr already computes the git branch and ahead/behind for each workspace (WorkspaceGitStatus, cached_git_ahead_behind) and shows them in the sidebar's default second row (e.g. main ↑1). API clients cannot get them: workspace.list, workspace.get, session.snapshot and the workspace_updated event carry no git fields. worktree.list gives the branch per worktree, but no ahead/behind, and a client has to map spaces to worktrees itself.
requested change
Add optional branch and ahead_behind: {ahead, behind} to WorkspaceInfo, filled from the existing cache, and emit workspace_updated when they change. Leave them out for spaces outside git.
why you want this
I am building a remote client that mirrors the herdr sidebar on iPad and Mac over SSH streamlocal. Its key is restricted to the socket (no shell), so it cannot run git on the host. With these fields the client could show the same branch ↑N ↓M as herdr's own sidebar, without polling worktree.list and guessing which worktree a space belongs to.
Originally filed as #5362, which was closed with a pointer to this category.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
idea / problem
herdr already computes the git branch and ahead/behind for each workspace (
WorkspaceGitStatus,cached_git_ahead_behind) and shows them in the sidebar's default second row (e.g.main ↑1). API clients cannot get them:workspace.list,workspace.get,session.snapshotand theworkspace_updatedevent carry no git fields.worktree.listgives the branch per worktree, but no ahead/behind, and a client has to map spaces to worktrees itself.requested change
Add optional
branchandahead_behind: {ahead, behind}toWorkspaceInfo, filled from the existing cache, and emitworkspace_updatedwhen they change. Leave them out for spaces outside git.why you want this
I am building a remote client that mirrors the herdr sidebar on iPad and Mac over SSH streamlocal. Its key is restricted to the socket (no shell), so it cannot run
giton the host. With these fields the client could show the samebranch ↑N ↓Mas herdr's own sidebar, without pollingworktree.listand guessing which worktree a space belongs to.Originally filed as #5362, which was closed with a pointer to this category.
All reactions