@klarkxy/dsh-git-commit 0.1.6 → 0.2.1

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
@@ -1,5 +1,8 @@
1
1
  # @klarkxy/dsh-git-commit
2
2
 
3
+ <!-- release-state-note -->
4
+ The [repository registry](../../README.md#plugin-lifecycle) tracks Draft → Testing → Published, moving forward only. Fixes, testing and version updates keep published packages Published; each update still passes release checks. First publication explicitly selects Testing packages and records Published only after npm archive verification. See the [release guide](../../RELEASING.md).
5
+
3
6
  Commit workspace changes to git without leaving the chat. Every conversation
4
7
  thread gets a **Commit** action in its header: click it, check the branch, the
5
8
  file count and the model that will be used, then confirm to commit every
@@ -10,12 +13,29 @@ directory.
10
13
 
11
14
  ## Install
12
15
 
13
- Requires Node.js ≥22. If your DSH distribution does not bundle this plugin,
14
- install it and enable its `git-commit` entry through the host plugin
15
- configuration.
16
+ Requires Node.js ≥22. Install the published package into the target profile
17
+ with the DSH plugin manager; the install also enables the `git-commit` entry:
18
+
19
+ ```sh
20
+ dsh plugin --profile web add @klarkxy/dsh-git-commit
21
+ ```
22
+
23
+ Replace `web` with your profile name. Installation or removal may require a
24
+ restart when the host asks for one.
25
+
26
+ To install a source checkout of this repository instead, pack it first and add
27
+ the archive:
16
28
 
17
29
  ```sh
18
- npm install @klarkxy/dsh-git-commit
30
+ cd plugins/dsh-git-commit
31
+ npm pack --ignore-scripts
32
+ dsh plugin --profile web add "<absolute path to the .tgz>"
33
+ ```
34
+
35
+ To uninstall:
36
+
37
+ ```sh
38
+ dsh plugin --profile web remove @klarkxy/dsh-git-commit
19
39
  ```
20
40
 
21
41
  ## How it works
@@ -52,6 +72,16 @@ nothing.
52
72
  The button is disabled while the session is running. The host checks again
53
73
  before committing, and stops the run if the workspace changes during planning.
54
74
 
75
+ If a later group fails or the run is cancelled, completed commits stay in place.
76
+ The panel shows those commits, the remaining groups and the stopping reason,
77
+ then refreshes repository status. A commit whose hash could not be read is
78
+ marked explicitly. It never rolls back completed commits or retries them
79
+ automatically. Unloading the plugin cancels in-flight planning and rejects new
80
+ runs while existing cleanup finishes.
81
+ If a rejected Git command leaves HEAD changed or unreadable, its group's outcome
82
+ is marked uncertain without attributing a commit to the plugin. Check Git log
83
+ and status before acting on that group; it is separate from groups not executed.
84
+
55
85
  ## Notes
56
86
 
57
87
  - Each selected file is committed from its current worktree content. Pre-staged
@@ -1,5 +1,8 @@
1
1
  # @klarkxy/dsh-git-commit
2
2
 
3
+ <!-- release-state-note -->
4
+ 插件生命周期见[仓库状态清单](../../../README.zh-CN.md#插件生命周期):草稿 → 测试中 → 已发布,只向前推进。已发布插件的修复、测试和升版保持已发布;每次更新仍须通过发布检查。首次发布须明确选择测试中的包,并在 npm 归档验证成功后登记。详见[发布规则](../../../RELEASING.zh-CN.md)。
5
+
3
6
  在对话里直接把工作区修改提交到 git。每个对话线程的右上角都有一个 **提交** 按钮:
4
7
  点一下打开弹层,确认分支、文件数量和将使用的模型,再点一下即可把会话工作目录
5
8
  所在仓库的全部未提交改动分次提交。
@@ -8,11 +11,27 @@
8
11
 
9
12
  ## 安装
10
13
 
11
- 需要 Node.js ≥22。若所用 DSH 发行版未内置本插件,可先安装,再通过宿主插件配置启用
14
+ 需要 Node.js ≥22。用 DSH 插件管理器把已发布包装进目标 profile,安装即启用
12
15
  `git-commit` 入口:
13
16
 
14
17
  ```sh
15
- npm install @klarkxy/dsh-git-commit
18
+ dsh plugin --profile web add @klarkxy/dsh-git-commit
19
+ ```
20
+
21
+ 把 `web` 换成你的 profile 名。安装或卸载后宿主可能要求重启。
22
+
23
+ 要装本仓库的源码,先打包再添加归档:
24
+
25
+ ```sh
26
+ cd plugins/dsh-git-commit
27
+ npm pack --ignore-scripts
28
+ dsh plugin --profile web add "<归档绝对路径>"
29
+ ```
30
+
31
+ 卸载:
32
+
33
+ ```sh
34
+ dsh plugin --profile web remove @klarkxy/dsh-git-commit
16
35
  ```
17
36
 
18
37
  ## 工作方式
@@ -36,6 +55,13 @@ npm install @klarkxy/dsh-git-commit
36
55
 
37
56
  会话运行期间按钮不可用。宿主在提交前还会再检查一次,规划期间工作区发生变化时会中止本次提交。
38
57
 
58
+ 后续分组失败或执行被取消时,已经完成的提交仍然保留。面板显示这些提交、剩余
59
+ 分组和停止原因,再刷新仓库状态;已创建但未能读回哈希的提交会明确标注。
60
+ 插件不会回滚已完成的提交,也不会自动重试。卸载插件会取消正在进行的规划,
61
+ 拒绝新的执行,并等待已有操作完成清理。
62
+ 如果 Git 命令报错后 HEAD 已变化或无法读回,对应分组会标为“结果不确定”,不擅自
63
+ 归属某个提交。请先检查 Git 日志和状态;这一组与尚未执行的分组分开显示。
64
+
39
65
  ## 说明
40
66
 
41
67
  - 每个选中文件按当前工作区内容提交。属于其他分组的已暂存修改会保留到对应分组提交。