Skip to content

Configurable trash directory location (trash on a separate filesystem) #3064

Description

@g-simmons

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions