@laoyuehanni/dsh-git-worktree 0.4.15 → 0.4.16

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
@@ -32,7 +32,7 @@
32
32
  | --- | --- |
33
33
  | **IDEA-Style Branch Picker** | `/` folder hierarchy, local & remote groups, instant search, locate-current-branch, and colored `↗N` / `↙N` / `↗` / `!` tracking marks. |
34
34
  | **In-Place Commit Graph** | Expand the popup to browse real commit history & merge graphs across any branch without switching checkouts. |
35
- | **One-Click Worktree Isolation** | Isolate sessions into `<repo>/.dsh/gitworktree/<branch>/` as real DSH workspaces while keeping the main repo's `git status` clean. |
35
+ | **One-Click Worktree Isolation** | Isolate sessions (and GitHub PRs / GitLab MRs, including fork PRs) into `<repo>/.dsh/gitworktree/<branch>/` while keeping the main repo's `git status` clean. |
36
36
  | **Safe Push, Update & Sync** | Compact push review dialog with tag options and explicit `force-with-lease`, fast-forward-only updates, and non-blocking floating progress cards. |
37
37
  | **Cross-Repo Worktree Manager** | Manage per-repo and legacy central worktrees from **Settings → Plugins**, with uncommitted-file warnings and safe session archival on removal. |
38
38
 
@@ -134,6 +134,7 @@ Existing worktree folders and plugin settings carry over untouched.
134
134
  - **Blank name = random branch**: when cutting a new branch into a worktree, leave the name empty to get `<base>-<4 hex>`, avoiding existing branches and folders.
135
135
  - **Official entry takeover** (setting "Take over official new-worktree entry", on by default): hides DSH's own new-worktree control in the top-right of blank sessions so worktrees are created from the branch menu, and withdraws any leftover official worktree request on that session to prevent nested creation. The changes and review panels are unaffected.
136
136
  - **Session directory mode** (setting "Switch worktree directory in current workspace", off by default): worktrees are no longer registered as standalone workspaces; the session's working directory moves inside its repository workspace, as DSH's own worktrees do. A new worktree is created only when the first message is sent: a pending bar above the composer can be cancelled until then, creation reports each phase, and a failure offers Retry or Continue without worktree. Opening an existing worktree that already has a standalone workspace enters that workspace.
137
+ - **Checkout PR / MR to isolated worktree**: open from the branch menu toolbar, a repository workspace's context menu, or DSH's optional Forge change-request card / diff toolbar. Fetches `refs/pull/<id>/head` (GitHub) or `refs/merge-requests/<id>/head` (GitLab) directly into `github-pr-<id>` / `gitlab-mr-<id>` without touching the main checkout — works with zero external CLI dependencies, and enhances with candidate lists, auto-tracking in the Forge panel, and one-click sync (including safe sync after remote force-push, with confirmation before discarding local commits) when `forge-bundle` is active.
137
138
  - **Official worktree management** (setting "Manage official worktrees", off by default): the manager also lists `<repo>/.agents/worktrees` under a "DSH official" group, which can be opened and removed manually but is never auto-pruned.
138
139
 
139
140
  > [!NOTE]
package/README.zh.md CHANGED
@@ -32,7 +32,7 @@
32
32
  | --- | --- |
33
33
  | **IDEA 风格分支树** | 按 `/` 折叠目录、本地/远程分组、实时搜索与定位当前分支,支持彩色 `↗N` / `↙N` / `↗` / `!` 上游状态标记。 |
34
34
  | **原位提交图谱** | 在分支弹窗内直接展开浏览任意分支的真实提交历史与合并图谱,无需切换检出。 |
35
- | **一键 Worktree 隔离** | 将会话隔离到 `<repo>/.dsh/gitworktree/<分支>/` 并注册为真实工作区,保持主仓库 `git status` 干净。 |
35
+ | **一键 Worktree 隔离** | 将会话(及 GitHub PR / GitLab MR,含外部 Fork PR)隔离到 `<repo>/.dsh/gitworktree/<分支>/`,保持主仓库 `git status` 干净。 |
36
36
  | **安全推送与后台进度** | 独立推送预览窗(支持 Tag 与 `force-with-lease`)、严格快进更新,以及不挡页面的悬浮实时进度卡。 |
37
37
  | **跨仓库工作树管理** | 在 **设置 → 插件** 中统一管理各仓库内与历史集中存放的 worktree,删除前风险提示并安全归档会话。 |
38
38
 
@@ -134,6 +134,7 @@ dsh plugin --profile web add @laoyuehanni/dsh-git-worktree
134
134
  - **留空即随机分支**:「新建分支并创建工作树」时分支名可留空,自动以 `<基分支>-<4位十六进制>` 命名并避开已有分支与目录。
135
135
  - **接管官方入口**(设置「接管官方新建工作树入口」,默认开):隐藏空白会话右上角 DSH 官方的新建工作树按钮,统一由左下角分支菜单创建,并撤销该会话上残留的官方工作树请求,避免嵌套创建;右侧变更与评审面板不受影响。
136
136
  - **会话目录模式**(设置「在当前工作区下切换工作树目录」,默认关):开启后工作树不再注册为独立工作区,而是在所属仓库工作区下切换会话工作目录(与 DSH 官方方式一致)。新建工作树延迟到发送首条消息时才执行,输入框上方显示待建条,可随时取消;创建过程分步显示进度,失败可「重试」或「不使用工作树继续」。打开已有工作树时,若它已有独立工作区则直接进入该工作区。
137
+ - **一键检出 PR / MR 到隔离工作树**:从分支菜单工具栏、主仓库右键菜单,或宿主可选 Forge PR 卡片 / Diff 工具栏打开。通过原生 Git 直接拉取 `refs/pull/<id>/head`(GitHub)或 `refs/merge-requests/<id>/head`(GitLab)到独立分支 `github-pr-<id>` / `gitlab-mr-<id>`,不改动主仓库当前分支;零外部 CLI 依赖可用,宿主启用 `forge-bundle` 时自动增强候选列表筛选、多 Remote 切换、会话 PR 面板回绑及已在 PR 工作树内的一键同步更新(远端 force-push 且本地无提交时自动同步,存在本地提交时二次确认防误丢)。
137
138
  - **纳管官方工作树**(设置「管理官方创建的工作树」,默认关):管理弹窗一并列出 `<repo>/.agents/worktrees` 下的官方工作树(「DSH 官方」分组),可打开与手动删除,但始终不参与自动清理。
138
139
 
139
140
  > [!NOTE]
package/docs/DETAIL.md CHANGED
@@ -7,6 +7,7 @@ The composer tool row gains a branch button: it opens the repository's branch me
7
7
  - **Read the history**: the graph button next to the menu expands the commit graph in place — browsing never checks out, selecting a commit shows its author, date, full message, and file summary; more pages load at the end, and loaded titles and hashes are searchable.
8
8
  - **Isolate into a worktree**: tick Worktree on a blank session (or right-click a branch and pick Create worktree) and the session starts at `<repo>/.dsh/gitworktree/<branch>` registered as a real workspace, reusing the directory when it already exists; branches held by worktrees collect in the Worktrees group, and Jump to this worktree opens a new session inside. Leave the new branch name blank to get a random `<base>-<4 hex>` name.
9
9
  - **Stay in one workspace if you prefer**: turn on "Switch worktree directory in current workspace" and worktrees open by moving the session's directory under its repository, as DSH's own worktrees do; a new worktree is created only when you send the first message, with Retry or Continue without worktree if it fails.
10
+ - **Checkout PR / MR into a worktree**: pick a PR/MR from the optional Forge candidate list or enter a number / URL to fetch `refs/pull/<id>/head` or `refs/merge-requests/<id>/head` into an isolated worktree without moving the main checkout; existing PR worktrees can be opened directly or synced to the latest commits (auto-syncing clean remote force-pushes, asking before discarding local commits).
10
11
  - **Sync remotes**: the toolbar refresh fetches every remote and prunes stale tracking branches; pushes and updates show a cancellable floating progress card that survives switching sessions.
11
12
 
12
13
  ## Some limits
package/docs/DETAIL.zh.md CHANGED
@@ -7,6 +7,7 @@
7
7
  - **看提交历史**:菜单旁的图谱按钮原位展开提交图谱:浏览不检出,选中看作者、时间、正文与文件摘要;滚到底自动加载,可按标题或哈希搜索。
8
8
  - **隔离进工作树**:空白会话勾选「工作树」(或右键分支行「创建工作树」),会话在 `<repo>/.dsh/gitworktree/<分支>` 开始并注册为真实工作区,重复创建复用已有目录;被占用的分支收进「工作树」分组,「跳到此工作树」直接进去开新会话。新分支名留空即自动生成 `<基分支>-<4位十六进制>`。
9
9
  - **想留在同一个工作区也行**:开启「在当前工作区下切换工作树目录」后,工作树改为在所属仓库下切换会话目录(同 DSH 官方方式);新建工作树延迟到发送首条消息时才执行,失败可「重试」或「不使用工作树继续」。
10
+ - **一键检出 PR / MR 到隔离工作树**:从可选 Forge 候选列表直选,或输入编号 / 链接,直接拉取 `refs/pull/<id>/head` 或 `refs/merge-requests/<id>/head` 到独立工作树,不动主检出;已有 PR 工作树可直接打开或一键同步最新(干净工作树遇远端 force-push 自动同步,有本地提交时先确认不静默覆盖)。
10
11
  - **同步远程**:工具栏刷新按钮 fetch 全部远程并清理失效跟踪分支;推送、更新期间有可取消的悬浮进度卡片,切换会话也在。
11
12
 
12
13
  ## 一些边界