Repository navigation
Replies: 1 comment
|
Was just thinking about how to solve this issue. In my case I want to remove db branches or docker containers |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
t3.jsonscripts can run when a worktree is created (runOnWorktreeCreate) and when a thread settles (runOnSettle). Nothing runs when T3 deletes a worktree, although T3 now deletes them automatically (Storage cleanup:worktreeOnDelete,worktreeOnMerge,worktreeAfterDays,worktreeUnchanged).Per-worktree state that lives outside the worktree directory therefore leaks. In our repo that is direnv's allow entry, plus the Nix GC roots behind
.direnvand the dev shell it pins. We also need to stop dev services that were started from the worktree.runOnSettleis not a substitute. A settled thread resumes in the same worktree, so tearing down the direnv/Nix state there forces a full dev-shell rebuild on every resume.Prior art
Codex local environments have a
[cleanup]script that runs when the worktree is removed, next to[setup]. We use it to rundirenv revoke, remove.direnv, and stop dev services, so this is a direct parity gap.Proposal
Add a boolean on a script, for example:
{ "name": "Teardown worktree", "command": "./scripts/teardown.sh", "runOnWorktreeDelete": true }T3CODE_WORKTREE_PATHandT3CODE_PROJECT_ROOT, like the create hook.runOnSettle.Context
Checked the public schema at https://t3.codes/schema/t3.json and the Nightly app bundle: the only
runOn*keys arerunOnWorktreeCreateandrunOnSettle.All reactions