[audit] Prune orphaned vim.pack plugins so removed entries stay removed#304
Merged
Merged
Conversation
nvim-web-devicons was manually stripped from the lock file in #285, but vim.pack never deletes packages left on disk when they drop out of package_list -- it just marks them inactive. The next vim.pack.update() call re-discovered the stale clone and wrote its lock entry right back, which is why it reappeared over the following days of auto-sync commits. sync_packages() now calls vim.pack.del() on any inactive package after vim.pack.add(), so removing an entry from package_list actually removes it going forward instead of being silently reverted on the next sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
nvim-web-deviconswas removed fromnvim-pack-lock.jsonby #285 (merged), becausemini.iconsnow mocks it and it's no longer inpackage_list. It reappeared in the lock file a few commits later (3a4f957→bbb40aa) and is back as of today.Where
lua/config/plugins.lua:74-79(thevim.packbranch ofsync_packages())Why it matters
vim.pack.add(package_list)only registers the plugins currently inpackage_list. It never deletes a plugin that drops out of the list — the on-disk clone (under the gitignoredpack/dir) just becomes "inactive".vim.pack.get()still reports it, and the subsequentvim.pack.update(nil, {...})call re-syncs the lock file against everythingvim.packknows about, so the stale entry gets written straight back in. #285's fix could only ever last until the next sync — it edited the symptom (the lock file) rather than the cause (vim.pack never being told to drop the package).This isn't specific to
nvim-web-devicons: any plugin removed frompackage_listin the future will silently keep reappearing in the lock file the same way, since nothing ever callsvim.pack.del().Fix
After
vim.pack.add(package_list), find packagesvim.pack.get()reports asnot active(i.e. no longer inpackage_list) andvim.pack.del()them beforevim.pack.update()runs:Also removes the now-genuinely-stale
nvim-web-deviconsentry fromnvim-pack-lock.jsonone more time — this time it should stick since the pruning step runs before the next auto-sync.Mechanical, low-risk change scoped to the
vim.packsync path only; the legacy git-clone fallback path is untouched.Generated by Claude Code