dev-prune v1.24.0 minor

by Krishna GSVV ·

dev-prune card reading Gigabytes back. Nothing you can't rebuild, listing node_modules and target as freed via their lockfiles and dist as skipped.

Frees disk space from idle Git repos by deleting dependency folders a lockfile can rebuild.

#rust #cli #devtools #tui #linux #macos #windows #apache-2.0 #ai-assisted

Changelog

Added
  • devp caches and devp status show what they are doing. A scan that takes a
    while now names the cache or repository it is on, counts how many are done, and after
    ten seconds on one item says so plainly: still measuring, this only reads, nothing is
    deleted, Ctrl-C is safe. --json and piped output stay clean.

  • Moved repositories keep their history wherever they went. Move a project to a
    different folder and the next scheduled pass finds it again by its first commit and
    re-points the old registry entry, with its freed-space total and last-pruned date, instead
    of registering a stranger. Two clones that share a first commit are never guessed
    between.

  • Dead registry entries clean themselves up. A path that stays missing for 30 days is
    dropped from registry.json, and so is a linked worktree that git worktree prune
    orphaned. Nothing on disk is touched. devp unlink --missing still clears them at once.

  • Repositories on a drive that is not connected are inactive, never lost. Unplug an
    external disk or lose a network share and its repositories show up in one "not
    connected" group in devp status, devp doctor and devp run, instead of as deleted
    paths. They are skipped by every pass, never dropped (no clock runs, so a drive left in a
    drawer for a year still has its history when it comes back), and return to normal on
    their own. devp unlink --missing now leaves them alone and tells you how to remove one
    on purpose (devp unlink <path>).

  • A drive that comes back somewhere else is followed, on Windows, macOS and Linux.
    dev-prune records each repository's volume identity in registry.json: the volume
    serial number and file system on Windows, the file system UUID on Linux (read from
    /proc/self/mountinfo and /dev/disk/by-uuid, so two btrfs subvolumes of one disk stay
    distinct), and the volume UUID on macOS (from diskutil). Plug a USB disk back in as
    F: instead of E:, or mount it at /media/you/Backup1 instead of /media/you/Backup,
    and the next pass finds it by that identity, checks each repository by its first commit,
    and re-points the entries with their history and settings. A path that now belongs to a
    different drive makes the entries inactive, so a prune pass can never reach another
    drive's folders by path, and two connected drives with the same identity (a cloned disk)
    are never guessed between. A file system with no UUID (some network mounts, tmpfs) is
    not followed and simply goes inactive while it is away.

  • Turn the drive following off with devp config set auto_follow_drives false. On by
    default. With it off, nothing is ever re-pointed to another drive; the safety behaviour
    stays on, so a path whose drive changed is still inactive and never pruned.

  • Every prune checks its drive again first. Right before a repository is touched,
    dev-prune re-reads the identity of its drive. If the disk was swapped or unplugged after
    the pass began, that repository is skipped with "drive for changed or is no longer
    connected, skipped", nothing is written, and the exit code is unchanged. In --json the
    repository appears with status skipped_drive.

  • Repositories inside WSL are not touched from Windows. A Windows devp that reaches
    into \\wsl$ or \\wsl.localhost treats it as a network path with no drive identity, so
    those paths are skipped with a line saying to install devp inside the distribution.
    The docs now have a "where to run devp" section covering WSL, containers, SSH hosts
    and cloud volumes: run devp on the machine that holds the repositories.

  • An optional size limit for caches that are safe to lose. Off by default. After
    devp config set cache_auto_trim true, the scheduled pass and a confirmed devp run
    empty the Go build cache or the ccache cache with its own command (go clean -cache,
    ccache --clear) once it is past cache_limit_gib (20 by default, per cache). Nothing
    else is ever touched: not the Go module cache, not download caches, not anything dev-prune
    would have to delete as a folder. devp caches marks any cache over the limit even with
    trimming off, and devp doctor mentions it as a note that never changes the exit code.
    The setup wizard asks, defaulting to no. devp run --dry-run lists what it would empty.

  • Two devp copies on one machine can no longer step on each other. The scheduled
    task, a manual devp run, a git hook and devp restore used to be free to run at the
    same time and overwrite each other's registry updates. Now only one pass runs at a time.
    A scheduled pass or a hook that finds another one running prints one line naming it (pid,
    version, start time) and exits 0; an interactive devp run, devp restore or
    devp unlink --missing names the holder and exits 1, so a script does not mistake
    "did nothing" for "done". The commands that change registry.json or empty a cache
    (config set, the devp config wizard, link, unlink, undo, init,
    doctor --fix, caches clear) do the same. devp status and devp update only skip
    their own bookkeeping write while a pass runs and still exit 0. devp caches, a plain
    doctor and the other read-only commands never wait. The lock is released by the operating system if devp dies, so it never goes stale.

  • An older devp refuses to overwrite a registry written by a newer one. registry.json
    records the version that last wrote it. If you still have an old copy on a scheduler or
    hook, it stops with "registry.json was written by devp X, this is Y; update this install
    or remove it, see devp doctor" instead of silently dropping the new fields. Reading
    still works. Copies older than this release cannot be protected, but they only lose
    fields that are filled in again.

  • devp doctor warns when several versions of devp are installed. It lists each copy
    with its path and version, says which one the scheduled task runs and which one the git
    hook shims call, and prints the way to remove the extras without running it. The same
    version in several places is only an information line. It now points at devp installs.

  • devp installs lists every devp on the machine. It shows each copy with its version,
    how it was installed (cargo, npm, pip, Homebrew, WinGet, Scoop, the install script and so on),
    where it sits on PATH or that it is on no PATH, and which one a new shell, the scheduler and
    the git hooks run. A closing sentence says when they disagree. Add --json for scripts.
    Copies reached through a symlink are listed once. A devp copied by hand into a folder that
    is on no PATH and in none of the usual places cannot be found, and the output says so.

  • devp installs clean removes the extra copies, one confirmed step at a time. It keeps
    the highest version (or the one you name with --keep <path>), shows the exact command for
    every other copy, and asks y/N before running it. Each copy is removed with its own
    manager (cargo uninstall, brew uninstall, npm uninstall -g, pip uninstall, winget uninstall and the rest), never by deleting files. A copy of unknown origin is described and
    left alone. If the scheduler or git hooks pointed at a removed copy they are moved to the one
    you kept, or you are told the single command to run. --dry-run prints the plan and runs
    nothing; it never needs administrator rights.

Changed
  • devp caches is about ten times faster on a cache-heavy machine. The sizing walks,
    the "which repositories depend on this cache" lookup and the container query now run at
    the same time. On a laptop with 159 registered repositories and a 160 GiB Go build cache
    it went from 4 minutes 44 seconds to 20 to 29 seconds.

  • devp status is about 3 times faster. Repository discovery spent most of its time
    asking the disk the same questions once per package manager. It now asks once per
    folder. 187 repositories went from 58 to 75 seconds down to 21 to 24 seconds (46 seconds
    on the first, cold-cache run).

  • A hung git can no longer wedge a scheduled pass. Read-only Git calls now give up
    after two minutes, skip that repository, and say which one. The same ceiling now covers
    the declared-directory check, hook install and the trust prompt, and a call that gave no
    answer is never read as "not ignored". There is still no overall
    time limit on a scan: a long scan that keeps making progress is never cut off.
    command_timeout_secs is, and always was, the limit for each package-manager command.

Fixed
  • devp caches clear no longer prints "Freed" next to a failure. When a manager's own
    clear command failed after removing part of a cache (Go on Windows reports "Access is
    denied" for files something else holds open), the output showed "not cleared" and then a
    green "Freed 161.93 GiB". It now shows a "partly cleared" row with what was freed and why
    the rest stayed, prints the manager's exit code as a number, and --json gains a
    partial field on each outcome.

  • The one-line install now works on a fresh Mac. On a new macOS account there is no
    ~/.zshrc, and the installer only edited rc files that already existed, so it finished
    cleanly and then every new terminal said devp: command not found (Homebrew worked
    because it puts the binary on a directory that is already on PATH). The installer now
    creates the rc file of your own login shell (~/.zshrc for zsh, ~/.bash_profile for
    bash on macOS, ~/.bashrc on Linux, config.fish for fish) when it is missing and adds
    the PATH line there.

For contributors
  • New src/volume.rs (Windows volume identity, behind a VolumeView seam so tests can
    inject fake drives) and Registry::heal_with. RepoEntry gains optional volume_id and
    volume_label; PathState gains Inactive. windows-sys gains the
    Win32_System_Diagnostics_Debug and Win32_System_IO features; no new crate. The run
    lock lives in src/lock.rs (LockFileEx on Windows, flock elsewhere).
  • New src/parallel.rs holds the shared work-stealing helper used by the cache sizing and
    the dependents lookup. DEV_PRUNE_SCAN_THREADS still overrides the thread count.
  • Registry::heal replaces the old heal pass; heal_dead_and_moved_repositories stays as a
    thin wrapper. RepoEntry has a new optional missing_since field that older registries
    simply do not have.

Install: curl -fsSL https://devprune.vkrishna04.me/install.sh | sh on macOS and Linux, uv tool install dev-prune or cargo binstall dev-prune anywhere. Full notes and checksums: https://github.com/Life-Experimentalist/dev-prune/releases/tag/v1.24.0

Links

← Back to the feed