dev-prune v1.24.0 minor
Frees disk space from idle Git repos by deleting dependency folders a lockfile can rebuild.
Changelog
Added
-
devp cachesanddevp statusshow 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.--jsonand 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 fromregistry.json, and so is a linked worktree thatgit worktree prune
orphaned. Nothing on disk is touched.devp unlink --missingstill 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 indevp status,devp doctoranddevp 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 --missingnow 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 inregistry.json: the volume
serial number and file system on Windows, the file system UUID on Linux (read from
/proc/self/mountinfoand/dev/disk/by-uuid, so two btrfs subvolumes of one disk stay
distinct), and the volume UUID on macOS (fromdiskutil). Plug a USB disk back in as
F:instead ofE:, or mount it at/media/you/Backup1instead 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--jsonthe
repository appears with statusskipped_drive. -
Repositories inside WSL are not touched from Windows. A Windows
devpthat reaches
into\\wsl$or\\wsl.localhosttreats 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: rundevpon 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 confirmeddevp run
empty the Go build cache or the ccache cache with its own command (go clean -cache,
ccache --clear) once it is pastcache_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 cachesmarks any cache over the limit even with
trimming off, anddevp doctormentions it as a note that never changes the exit code.
The setup wizard asks, defaulting to no.devp run --dry-runlists what it would empty. -
Two devp copies on one machine can no longer step on each other. The scheduled
task, a manualdevp run, a git hook anddevp restoreused 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 interactivedevp run,devp restoreor
devp unlink --missingnames the holder and exits 1, so a script does not mistake
"did nothing" for "done". The commands that changeregistry.jsonor empty a cache
(config set, thedevp configwizard,link,unlink,undo,init,
doctor --fix,caches clear) do the same.devp statusanddevp updateonly 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 doctorwarns 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 atdevp installs. -
devp installslists 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--jsonfor 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 cleanremoves 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 uninstalland 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-runprints the plan and runs
nothing; it never needs administrator rights.
Changed
-
devp cachesis 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 statusis 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
gitcan 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_secsis, and always was, the limit for each package-manager command.
Fixed
-
devp caches clearno 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--jsongains a
partialfield 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 saiddevp: 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 (~/.zshrcfor zsh,~/.bash_profilefor
bash on macOS,~/.bashrcon Linux,config.fishfor fish) when it is missing and adds
the PATH line there.
For contributors
- New
src/volume.rs(Windows volume identity, behind aVolumeViewseam so tests can
inject fake drives) andRegistry::heal_with.RepoEntrygains optionalvolume_idand
volume_label;PathStategainsInactive.windows-sysgains the
Win32_System_Diagnostics_DebugandWin32_System_IOfeatures; no new crate. The run
lock lives insrc/lock.rs(LockFileExon Windows,flockelsewhere). - New
src/parallel.rsholds the shared work-stealing helper used by the cache sizing and
the dependents lookup.DEV_PRUNE_SCAN_THREADSstill overrides the thread count. Registry::healreplaces the old heal pass;heal_dead_and_moved_repositoriesstays as a
thin wrapper.RepoEntryhas a new optionalmissing_sincefield 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
- source code
- homepage
- license: Apache-2.0