docs: document interrupted-worktree recovery and gitignore dirty-detection#40
docs: document interrupted-worktree recovery and gitignore dirty-detection#40baruch wants to merge 1 commit into
Conversation
…ction Add a "Recovering an interrupted worktree" section to the README covering what happens when a `get` subshell ends abnormally (crash, OOM, closed terminal): the stale owner reservation is self-healed, uncommitted work stays protected, and you recover it via `treehouse status` + `cd`. Flag the two clean-tree cases that are NOT protected -- committed work and gitignored-only changes -- and point to `get --lease` for durable holds. Also clarify, in both the README "Dirty detection" highlight and the AGENTS.md design note, that .gitignore'd files are not counted dirty (so such a worktree can be reused) but are not deleted by the reset, since `git clean -fd` runs without `-x` and respects `.gitignore`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for treehouse#40 at |
|
Automated reminder: this PR still looks blocked on a rebase or merge conflict fix. If you are still interested, please rebase onto the current base branch, resolve the conflict, and push. If I do not hear back, I may close this as inactive. |
|
I am closing this because it has been waiting on a rebase or merge-conflict fix since 2026-07-10, and I have not seen a comment or push since then. If you still want to keep working on this, please reopen it or open a new PR and mention this one. Happy to take another look when there is an update. |
What
Adds user- and agent-facing docs for two behaviors that were previously only
derivable by reading the code.
1. Recovering an interrupted worktree (README)
1. Recovering an interrupted worktree (README)
New "Recovering an interrupted worktree" section covering what happens when
a
treehouse getsubshell ends abnormally — closed terminal, crash, or OOM:self-healed on the next command, and uncommitted work (tracked or
untracked) stays protected from
getreuse,prune, anddestroy.treehouse statusto find thedirtyworktree by path,cdin to resume,treehouse return <path>when done.non-leased worktree — committed work (reclaimed by
git reset --hard,recoverable via
git reflog) and.gitignored-only changes — and pointingto
treehouse get --leasefor durable holds across crashes.2.
.gitignored files vs. dirty detection (README + AGENTS.md)Clarifies a previously-undocumented edge case: ignored files are not counted
as dirty (so a worktree whose only leftover content is ignored can be reused),
but treehouse's reset never deletes them either —
ResetWorktreerunsgit clean -fd(without-x), which respects.gitignore.Why
The dirty-detection note previously said only "untracked files count as dirty."
The crash-recovery flow and the ignored-files nuance are accurate in the code
(
IsDirty,ResetWorktree,healState,Acquire) but were undocumented —exactly the behavior a user relies on when an agent session dies.
Scope
Documentation only — no code changes. Touches
README.mdandAGENTS.md(the design-decisions note;
CLAUDE.mdsymlinks to it). 2 files, +26/−2.