dsh-git-scm 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,18 +6,36 @@ sidebar and works on the checkout of the Session's current working directory.
6
6
 
7
7
  ## What it shows
8
8
 
9
- - **Repository header**: repository name, a status-bar-style branch chip whose
10
- branch name opens a searchable branch switcher (local and remote branches,
11
- with the dirty `*` / staged `+` markers and ahead/behind counts) and whose
12
- cloud control publishes the branch when it has no upstream, hover tooltips
13
- naming the repository, branch, and action, upstream, and the last fetch time.
9
+ - **Repository header**: a repository glyph whose tooltip names the repository
10
+ (there is no visible repository-name label, so the branch chip gets the room),
11
+ a status-bar-style branch chip whose branch name opens a searchable branch
12
+ switcher (local and remote branches, with the dirty `*` / staged `+` markers
13
+ and ahead/behind counts) and whose cloud control publishes the branch when it
14
+ has no upstream. The hover tips name the repository, branch, and action: the
15
+ branch chip reads `demo-repo (Git) - main, Checkout branch/tag…` and the
16
+ publish control reads `demo-repo (Git) - Publish to GitHub`. The header also
17
+ carries a **Refresh** control and a Zed-style sync split control. The sync
18
+ control's primary segment is the action
19
+ the branch state calls for — **Publish** (which opens the publish dialog when
20
+ the repository has no remote), **Pull ↓n ↑n**, **Push ↑n**, or **Fetch** — and
21
+ its chevron opens the full command list: Fetch, Fetch From, Pull, Pull
22
+ (Rebase), Push, Push To, and Force Push; Fetch From and Push To open a remote
23
+ submenu, and Force Push asks first. The sync row below the header carries the
24
+ upstream, the ahead/behind counts, the last fetch time, the flat/tree view
25
+ toggle, and the bulk change menu. In a panel narrower than 340px the pill
26
+ drops its ahead/behind counts (the sync row repeats them) and the branch
27
+ chip's cloud button retires, since the pill's Publish primary already covers
28
+ it. A linked checkout marks the header with a compact folder-glyph badge
29
+ labelled **Linked worktree** for assistive tech, whose tooltip names the
30
+ checkout path.
14
31
  - **Publish a branch**: while the current branch has never been pushed the
15
- commit action becomes **Publish Branch** and the header's push control routes
16
- a missing remote into the publish dialog instead of failing: choose a private
32
+ commit action becomes **Publish Branch** and the sync control's primary
33
+ segment becomes **Publish**, which opens the publish dialog directly when the
34
+ repository has no remote: choose a private
17
35
  or public GitHub repository (created through an authenticated `gh` CLI,
18
36
  default name from the folder) or fall back to any custom remote URL. After
19
37
  the push the branch tracks its new upstream and the panel returns to the
20
- ordinary commit and push controls.
38
+ ordinary commit and sync controls.
21
39
  - **Not a Git repository yet**: a Session directory outside Git shows an empty
22
40
  state with two actions and a refresh control. **Initialize repository** runs
23
41
  `git init -b main` and reads the new checkout; **Publish to Git** initializes
@@ -54,12 +72,29 @@ sidebar and works on the checkout of the Session's current working directory.
54
72
  whole and ellipsizes the grey directory suffix instead of hiding it outright;
55
73
  the tree keeps its directory rows at any width.
56
74
  - **Change lists right under the repository header**: the staged and
57
- working-tree sections follow the header directly; the header row itself
58
- carries the refresh, fetch, pull, push, and bulk-action controls, so no
59
- separate "Changes" group row takes space.
60
- - **A collapsible Git repositories group** (branches, remotes, stashes, tags)
61
- whose sections are indented under it; every section collapses on its own and
62
- the group title carries no counter.
75
+ working-tree sections follow the header directly; the header row carries
76
+ refresh and the sync split control, the sync row beside it carries the view
77
+ toggle and the bulk change menu, so no separate "Changes" group row takes
78
+ space.
79
+ - **A collapsible Git repositories group** (worktrees, branches, remotes,
80
+ stashes, tags) whose sections are indented under it; every section collapses
81
+ on its own and the group title carries no counter.
82
+ - **Worktrees**: the repository's checkouts in one list ahead of the branches —
83
+ the main checkout, linked ones, and registrations whose directory is gone
84
+ (marked missing, carrying Git's prune reason). A row names its branch and
85
+ shows the directory relative to this checkout; the current one is marked, and
86
+ a locked one says so. The row menu offers **Switch to this worktree**, **Copy
87
+ worktree path**, and **Remove worktree**; removal asks first and, when the
88
+ checkout has uncommitted changes, offers an explicit **Force Remove** after a
89
+ second confirmation. A missing registration offers **Prune missing worktrees**
90
+ instead. The section's **New Worktree** action creates a branch at the current
91
+ HEAD in `<repository>/.agents/worktrees/<slug>` (the pool keeps itself out of
92
+ Git's status through a `.gitignore` of `*`), or checks out an existing local
93
+ branch there, then offers to move this Session into the new checkout.
94
+ Clicking a linked row — or confirming a switch — moves the Session's working
95
+ directory into that checkout, and the panel re-reads itself there. A linked
96
+ checkout marks the header with a compact folder-glyph badge whose tooltip
97
+ names its path.
63
98
  - **Docked comparison**: clicking a changed file, a commit's file, or a stash
64
99
  opens its comparison in a pane that docks below the list by default (a
65
100
  draggable divider resizes it and the size is remembered) and can be switched
@@ -67,7 +102,11 @@ sidebar and works on the checkout of the Session's current working directory.
67
102
  resize its width (double-clicking a divider restores the default size); the
68
103
  divider is a layout-free seam that sits exactly on the pane border and
69
104
  highlights on hover, and the dock keeps a 280px minimum while stopping at the
70
- list's 300px reservation when the panel is wide enough. Rows carry
105
+ list's 300px reservation when the panel is wide enough. The title row is a
106
+ disclosure control: clicking it folds the body to one strip and clicking it
107
+ again unfolds it. A panel narrower than 580px starts the comparison folded
108
+ below the list, while a fullscreen Sidebar opens it docked on the right and
109
+ unfolded. Rows carry
71
110
  old and new line numbers, long unchanged runs collapse to their edges and
72
111
  expand on click, the pane switches between single-column and side-by-side
73
112
  views, expands to nearly the whole panel, toggles word wrap (the choice
@@ -105,13 +144,21 @@ still works through a custom remote URL.
105
144
  Commit-message generation uses the app's configured default model; a profile
106
145
  without a model route reports that generation is unavailable while the rest of
107
146
  the panel keeps working.
147
+ Switching a Session between worktrees uses the host's `agents` and
148
+ `workingDirectory` services; a profile that lacks them still lists the
149
+ worktrees but reports that switching is unavailable.
108
150
 
109
151
  ## What it does
110
152
 
111
- - The message field starts one line tall and grows to six lines; ticking
112
- **Amend** fills it with the previous commit message and unticking restores the
113
- draft that was there before.
114
- - Stage, unstage, discard, and commit (including amend). Multi-select works with
153
+ - The message field starts one line tall and grows to six lines; the commit
154
+ split button's label states what a click will do — **Commit**, **Commit
155
+ Tracked** (nothing staged: the tracked working changes are staged first, and
156
+ untracked files are left out), **Amend**, or **Amend Tracked** — and its
157
+ chevron menu carries the amend toggle, which fills the field with the
158
+ previous commit message and restores the draft when turned off (an inline
159
+ note marks the amended state).
160
+ - Stage, unstage, discard, and commit (including amend through the commit
161
+ menu). Multi-select works with
115
162
  `Ctrl`/`Cmd`-click and `Shift`-click; while a section has a selection its
116
163
  header row shows the count plus the stage/unstage/discard commands beside the
117
164
  bulk stage-all command, so the list gains no extra row.
@@ -121,9 +168,10 @@ the panel keeps working.
121
168
  selection shows its total and a parenthesised selection count beside the
122
169
  title and keeps no per-selection header controls; the row actions and the
123
170
  context menu still apply to the whole selection.
124
- - The repository header's more-actions menu offers stage all, unstage all,
125
- discard all, stash all (with untracked), commit all, undo the last commit,
126
- fetch, pull, and push.
171
+ - The bulk change menu beside the sync row offers stage all, unstage all,
172
+ discard all, stash all (with untracked), commit all, and undo the last
173
+ commit; the sync split control's menu carries fetch, pull, push, and force
174
+ push, including fetching from or pushing to one named remote.
127
175
  - Menus, the branch switcher, and dialogs use the host's own surface
128
176
  tokens (`--dsw-menu-surface-fill`, `--dsw-menu-backdrop-filter`,
129
177
  `--dsw-elevation-prominent`, `--dsw-alias-toast-bg`, the radius and menu-icon
@@ -144,10 +192,12 @@ the panel keeps working.
144
192
  on the right; later opens replace that preview tab instead of adding tabs.
145
193
  Deleted files cannot be opened; when the pane cannot split (too narrow, or
146
194
  already split) the preview opens as another tab in the active pane.
147
- - Fetch all remotes, pull, and push; a branch with no upstream gets one on push.
148
- A fetch reports whether remote references actually moved ("no new commits" vs
149
- "N references updated"), and the remotes header carries the last fetch time
150
- inline, so freshness costs no extra row.
195
+ - Fetch, pull, and push from the sync split control; a branch with no upstream
196
+ gets one on push. **Fetch From** fetches one named remote and **Push To**
197
+ pushes the current branch to one; **Force Push** confirms first, then pushes
198
+ with a lease. A fetch reports whether remote references actually moved ("no
199
+ new commits" vs "N references updated"), and the remotes header carries the
200
+ last fetch time inline, so freshness costs no extra row.
151
201
  Refresh, fetch, pull, push, commit, and branch operations re-read every expanded
152
202
  branch's commit list and every expanded commit's files, so refreshed history
153
203
  replaces the cached lists instead of leaving stale rows. Branch rows switch
@@ -156,9 +206,16 @@ the panel keeps working.
156
206
  branch has unpushed work, amber when it has unpulled commits. Hovering a
157
207
  branch that is behind its upstream adds a pull control that fetches and
158
208
  fast-forwards exactly that branch (without checking it out); branches with
159
- nothing to pull show no such control. Committing also offers "commit all changes" and "undo last
160
- commit".
161
- - `⌘Enter` / `Ctrl+Enter` commits from the message field.
209
+ nothing to pull show no such control. Committing also offers "commit all
210
+ changes" and "undo last commit" from the commit split button's menu.
211
+ - Worktree rows move the Session between checkouts: clicking a linked row (or
212
+ its menu's **Switch to this worktree**) asks, then re-reads the panel in the
213
+ new checkout; **New Worktree** creates a branch's checkout in the
214
+ repository's `.agents/worktrees` pool and offers the same move; removal
215
+ retries through an explicit force confirmation when Git refuses a dirty
216
+ checkout, and prune clears registrations whose directories are gone.
217
+ - `⌘Enter` / `Ctrl+Enter` commits from the message field; with nothing staged
218
+ it stages the tracked changes first, exactly like **Commit Tracked**.
162
219
 
163
220
  ## Where it appears
164
221
 
@@ -177,15 +234,18 @@ JSON route on the shared web server:
177
234
  Actions: `summary`, `github`, `commitMessage`, `status`, `commits`,
178
235
  `commitFiles`, `commitDiff`, `stashDiff`, `fileHistory`, `diff`, and `action`.
179
236
  `github` reads the GitHub CLI account for the publish dialog, `commitMessage`
180
- asks the configured model to write or improve a message, and `fileHistory`
181
- pages one file's commit history.
237
+ asks the configured model to write or improve a message, `fileHistory` pages
238
+ one file's commit history, and the one `action` operation that is not a Git
239
+ command — `switchWorktree` — asks the Host to move the Session's working
240
+ directory into a registered checkout after validating it against the
241
+ repository's worktree list.
182
242
  - Only same-origin JSON POSTs are admitted. A request names a Session, never a
183
243
  path: the Host half resolves the Session's effective working directory through
184
244
  the `workingDirectory` service, so a page cannot reach a directory the open
185
245
  Session does not already belong to.
186
246
  - Reading is lazy: the opening snapshot carries identity, changes, branches,
187
- stashes, and tags; a branch's commits and a commit's files are read only when
188
- that tree node expands.
247
+ stashes, tags, and the registered worktrees; a branch's commits and a commit's
248
+ files are read only when that tree node expands.
189
249
  - Every Git invocation goes through `ctx.subprocess` (executable resolution plus
190
250
  a collected spawn) with a fixed prefix that disables hooks, optional index
191
251
  writes, and the filesystem monitor. Local commands are bounded at 30 s and
@@ -241,7 +301,9 @@ plugin bundled with the DSH checkout: at migration time its behavior, route
241
301
  shape, Git argv, error codes, and UI structure matched the original. The two are
242
302
  no longer identical — since the port this package has added branch publishing to
243
303
  a custom remote or a new GitHub repository, repository initialization,
244
- model-written commit messages, and word wrap in the comparison pane.
304
+ model-written commit messages, word wrap in the comparison pane, the Zed-style
305
+ sync and commit split controls with their remote and commit menus, and Git
306
+ worktree management with Session switching.
245
307
 
246
308
  - **Host half** (`src/index.ts`, `src/host/git.ts`): strict TypeScript
247
309
  (`tsconfig.json`, extends the repo base). The Cordis context services are
@@ -264,7 +326,8 @@ model-written commit messages, and word wrap in the comparison pane.
264
326
  ## Known limitations
265
327
 
266
328
  - One repository per Session: the panel reads the checkout that contains the
267
- Session's working directory and does not offer a repository picker.
329
+ Session's working directory and does not offer a repository picker; switching
330
+ between that repository's worktrees moves the Session's working directory.
268
331
  - No merge, rebase, blame, or history graph; conflicts are shown and can be
269
332
  staged after they are resolved outside the panel.
270
333
  - Branch lists are capped at 500 local and 500 remote branches.