@henryqw/pi-herdr-done 2.0.0 → 2.0.2
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 +9 -23
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@henryqw/pi-herdr-done`
|
|
2
2
|
|
|
3
|
-
Finish a Herdr-managed linked
|
|
3
|
+
Finish a Herdr-managed linked-worktree task by removing its checkout, closing its workspace tabs, and fast-forwarding its primary checkout when possible. Normal removal refuses dirty worktrees and worktrees in use by another Herdr workspace; `--force` can delete uncommitted work and leave those tabs pointing at the removed checkout.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Finish a Herdr-managed linked worktree task by removing its checkout, closing it
|
|
|
8
8
|
pi install npm:@henryqw/pi-herdr-done
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Requires the Herdr CLI and
|
|
11
|
+
Requires the Herdr CLI and Pi running inside a Herdr-managed linked worktree.
|
|
12
12
|
|
|
13
13
|
## Works with
|
|
14
14
|
|
|
@@ -18,37 +18,23 @@ Requires the Herdr CLI and a Pi session running inside a Herdr-managed linked wo
|
|
|
18
18
|
|
|
19
19
|
## Use
|
|
20
20
|
|
|
21
|
-
Commit or discard
|
|
21
|
+
Commit or discard changes, then run `/done` and confirm. It removes the checkout and closes every tab in the same Herdr workspace.
|
|
22
22
|
|
|
23
23
|
| Surface | Type | Purpose |
|
|
24
24
|
| --- | --- | --- |
|
|
25
|
-
| `/done` | command | Remove the current worktree
|
|
26
|
-
| `/done --force` | command | Same, even when the worktree is dirty or used by tabs in another workspace. |
|
|
25
|
+
| `/done [--force]` | command | Remove the current worktree and close its Herdr workspace tabs; `--force` skips confirmation and permits forced removal without checking for tabs in other workspaces. |
|
|
27
26
|
|
|
28
27
|
## Flow
|
|
29
28
|
|
|
30
29
|

|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
Normal `/done` asks for confirmation before waiting for Pi to become idle; declining leaves the checkout untouched. `/done --force` skips confirmation. Both wait for Pi to become idle before cleanup.
|
|
33
32
|
|
|
34
|
-
Normal removal
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
git worktree remove .
|
|
38
|
-
herdr tab close <other-tabs-in-$HERDR_WORKSPACE_ID>
|
|
39
|
-
git -C <parent> pull --ff-only
|
|
40
|
-
herdr tab close "$HERDR_TAB_ID"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
- The parent pull runs only when this session ran in a linked worktree with a non-bare primary.
|
|
44
|
-
- It fails safely when the parent has diverged.
|
|
45
|
-
- Parent tabs do not block worktree removal or the parent pull.
|
|
46
|
-
- Once removal succeeds, every tab in the current Herdr workspace closes, even when the parent pull fails.
|
|
47
|
-
- Concurrent completions serialize on a lock around the parent checkout.
|
|
33
|
+
Normal cleanup checks whether a tab in another Herdr workspace is using the checkout, removes it with `git worktree remove <checkout>`, closes every other tab in the current Herdr workspace, and runs `git pull --ff-only` from the primary checkout when this was a linked worktree and the primary is non-bare. It closes the current tab last. Tabs using the primary checkout do not block removal or the pull. Concurrent completions serialize on locks around the worktree and primary checkout.
|
|
48
34
|
|
|
49
35
|
## Limits and recovery
|
|
50
36
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
37
|
+
- `/done` refuses to remove a dirty worktree. Commit or discard changes first. `/done --force` passes `--force` to Git and can irreversibly delete uncommitted work.
|
|
38
|
+
- A tab in another Herdr workspace that uses this checkout blocks normal removal. `/done` lists the tab label, or its ID when no label is available. Close the tab and retry, or use `/done --force` only if you accept removing the checkout while that tab still refers to it. Tabs in other workspaces are not closed.
|
|
53
39
|
- The command requires Pi inside Herdr with `HERDR_ENV=1`, `HERDR_WORKSPACE_ID`, and `HERDR_TAB_ID` set.
|
|
54
|
-
-
|
|
40
|
+
- The primary checkout update runs only after worktree removal. If `git pull --ff-only` fails, for example because the primary has diverged or has local changes, the worktree is already gone and the current tab still closes. Resolve the primary checkout issue, then retry with `git -C <primary-checkout> pull --ff-only`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-herdr-done",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Close and remove the current Herdr worktree from Pi.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"pack:check": "npm pack --dry-run"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@earendil-works/pi-coding-agent": "
|
|
28
|
+
"@earendil-works/pi-coding-agent": ">=0.86.0 <0.88.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@henryqw/pi-herdr": "^0.4.1"
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
50
|
+
"@earendil-works/pi-coding-agent": "0.87.0"
|
|
51
51
|
}
|
|
52
52
|
}
|