@maxiaochao/pi-worktree 0.4.0 → 0.4.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/CHANGELOG.md +5 -0
- package/README.md +4 -0
- package/TESTING.md +4 -0
- package/bin/pi-worktree +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-10-23 - v0.4.1
|
|
4
|
+
|
|
5
|
+
- return the worktree root from already-active nested directories
|
|
6
|
+
- Return Git's canonical worktree root for already-active create calls made from a nested directory; preserve the dirty flag.
|
|
7
|
+
|
|
3
8
|
## 2026-10-12 - v0.4.0
|
|
4
9
|
|
|
5
10
|
- Replace CLI start and prepare with the create-only command
|
package/README.md
CHANGED
|
@@ -72,3 +72,7 @@ pi-worktree prune
|
|
|
72
72
|
`create` 是幂等接口;`create --json` 供 Extension 和其他宿主使用,返回 `created`、`attached`、`reused` 或 `already-active`,以及绝对路径、分支和 dirty 状态。已有 worktree 会复用;已存在但未挂载的同名分支会挂载;stale 注册、非法名称和路径冲突会显式失败。
|
|
73
73
|
|
|
74
74
|
Agent 用法见 `skills/pi-worktree/SKILL.md`。测试流程、夹具和结果见 [TESTING.md](TESTING.md)。
|
|
75
|
+
|
|
76
|
+
## Already-active paths
|
|
77
|
+
|
|
78
|
+
`pi-worktree create --json <current-worktree-name>` returns the canonical Git worktree root, even when called from a nested directory. The `already-active` status and whole-worktree `dirty` flag remain unchanged. The extension uses the same CLI result.
|
package/TESTING.md
CHANGED
|
@@ -24,3 +24,7 @@
|
|
|
24
24
|
## 最近验证结果
|
|
25
25
|
|
|
26
26
|
验收要求全部 Node/shell 断言通过,Extension 能被 Pi 单独加载,且 `npm pack --dry-run` 包含 `bin/`、`extensions/`、`skills/` 和 `scripts/install.mjs`。
|
|
27
|
+
|
|
28
|
+
## Review regressions
|
|
29
|
+
|
|
30
|
+
The CLI integration suite also calls `create --json` from a nested linked-worktree directory. It asserts `already-active`, the canonical worktree root, and the whole-worktree dirty flag. Load the extension with `pi -ne -ns --no-session -e ./packages/worktree/extensions/worktree.ts`; this package has no `load-test` npm script.
|
package/bin/pi-worktree
CHANGED
|
@@ -246,7 +246,7 @@ create_wt() {
|
|
|
246
246
|
[[ "$current_branch" == "$name" ]] \
|
|
247
247
|
|| die "already inside linked worktree '$current_branch'; return to the main checkout first"
|
|
248
248
|
CREATE_STATUS="already-active"
|
|
249
|
-
CREATE_DIR=$(pwd -P)
|
|
249
|
+
CREATE_DIR=$(cd "$(git rev-parse --show-toplevel)" && pwd -P)
|
|
250
250
|
CREATE_BRANCH="$current_branch"
|
|
251
251
|
CREATE_DIRTY=false
|
|
252
252
|
if [[ -n "$(git status --porcelain)" ]]; then CREATE_DIRTY=true; fi
|