mirror of
https://github.com/obra/superpowers.git
synced 2026-07-24 03:04:02 +08:00
Compare commits
1 Commits
dev
...
fix/worktr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0e2ab912 |
@@ -174,6 +174,29 @@ git worktree remove "$WORKTREE_PATH"
|
|||||||
git worktree prune # Self-healing: clean up any stale registrations
|
git worktree prune # Self-healing: clean up any stale registrations
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**If removal is refused** (`contains modified or untracked files`): the
|
||||||
|
worktree holds files that exist nowhere else — uncommitted plans, notes,
|
||||||
|
or scratch work. Never `--force` on your own initiative. Show your human
|
||||||
|
partner what is at stake and ask:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git -C "$WORKTREE_PATH" status --porcelain
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Worktree removal refused — these files were never committed:
|
||||||
|
|
||||||
|
<file list>
|
||||||
|
|
||||||
|
1. Commit them to <branch> before cleanup
|
||||||
|
2. Move them into <main repo root>
|
||||||
|
3. Delete them (unrecoverable)
|
||||||
|
|
||||||
|
Which?
|
||||||
|
```
|
||||||
|
|
||||||
|
Carry out the choice, then remove the worktree.
|
||||||
|
|
||||||
**Otherwise:** The host environment owns this workspace — leave it in
|
**Otherwise:** The host environment owns this workspace — leave it in
|
||||||
place. If your platform provides a workspace-exit tool, use it.
|
place. If your platform provides a workspace-exit tool, use it.
|
||||||
|
|
||||||
@@ -196,6 +219,7 @@ place. If your platform provides a workspace-exit tool, use it.
|
|||||||
| "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
|
| "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
|
||||||
| "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
|
| "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
|
||||||
| "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
|
| "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
|
||||||
|
| "Removal refused — `--force` is just finishing the cleanup" | The refusal means files exist only in that worktree. `--force` destroys them permanently. Show your human partner and ask. |
|
||||||
| "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
|
| "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
|
||||||
| "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
|
| "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
|
||||||
| "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |
|
| "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |
|
||||||
|
|||||||
Reference in New Issue
Block a user