Summary
Allow the worktree trash directory to be configured, so it can live on a different filesystem than the repo.
Motivation
wt's trash dir is currently hardcoded to <git-common-dir>/wt/trash (the Repository::wt_trash_dir path). On a repo with many large worktrees (ours have full node_modules trees), trash accumulates fast — ours reached 78 GB / ~3.8M files. That can fill the repo's disk while plenty of space exists on a separate bulk volume.
There's no config key or env var to redirect it today (wt config exposes worktree-path but nothing for trash; the binary has no WORKTRUNK_*TRASH setting).
Request
A configurable trash location, e.g. one of:
trash-path in config.toml (templated like worktree-path), or
- a
WORKTRUNK_TRASH_DIR env var.
Ideally per-project overridable, same as worktree-path.
Current workaround
Symlink the trash dir to a bigger filesystem:
mv <repo>/.git/wt/trash /mnt/bigstorage/<repo>-wt-trash
ln -s /mnt/bigstorage/<repo>-wt-trash <repo>/.git/wt/trash
This works and is transparent to wt (and to tools that compute the same path), but a native config option would be cleaner and survive .git/wt recreation.
Thanks for worktrunk!
Summary
Allow the worktree trash directory to be configured, so it can live on a different filesystem than the repo.
Motivation
wt's trash dir is currently hardcoded to<git-common-dir>/wt/trash(theRepository::wt_trash_dirpath). On a repo with many large worktrees (ours have fullnode_modulestrees), trash accumulates fast — ours reached 78 GB / ~3.8M files. That can fill the repo's disk while plenty of space exists on a separate bulk volume.There's no config key or env var to redirect it today (
wt configexposesworktree-pathbut nothing for trash; the binary has noWORKTRUNK_*TRASHsetting).Request
A configurable trash location, e.g. one of:
trash-pathinconfig.toml(templated likeworktree-path), orWORKTRUNK_TRASH_DIRenv var.Ideally per-project overridable, same as
worktree-path.Current workaround
Symlink the trash dir to a bigger filesystem:
This works and is transparent to
wt(and to tools that compute the same path), but a native config option would be cleaner and survive.git/wtrecreation.Thanks for worktrunk!