aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/pack.lua
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2025-11-13 15:49:17 +0200
committerEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2025-11-16 22:19:10 +0200
commit18e6ba90e25327dd8b34960902f3433cf00259dc (patch)
tree87d23ad88b2167099cc8e9d2a54dee0c85c82c53 /runtime/lua/vim/pack.lua
parent2e533e364e2d52bcfe531d8ddd4a148d3f3bfed1 (diff)
downloadrneovim-18e6ba90e25327dd8b34960902f3433cf00259dc.tar.gz
rneovim-18e6ba90e25327dd8b34960902f3433cf00259dc.tar.bz2
rneovim-18e6ba90e25327dd8b34960902f3433cf00259dc.zip
docs(pack): add example workflow of how to revert after a bad update
Problem: No example workflow of how to revert after a bad update. Solution: Add example workflow of how to revert after a bad update. In future this might be improved by utilizing other `vim.pack` features or via a dedicated function (like `vim.pack.restore()` that restores all installed plugins to a state from the lockfile).
Diffstat (limited to 'runtime/lua/vim/pack.lua')
-rw-r--r--runtime/lua/vim/pack.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/lua/vim/pack.lua b/runtime/lua/vim/pack.lua
index 793d712479..8e9693d0ff 100644
--- a/runtime/lua/vim/pack.lua
+++ b/runtime/lua/vim/pack.lua
@@ -91,6 +91,18 @@
---you want it to be updated.
---- |:restart|.
---
+---Revert plugin after an update:
+---- Locate plugin's revision at working state. For example:
+--- - If there is a previous version of |vim.pack-lockfile| (like from version
+--- control history), use it to get plugin's `rev` field.
+--- - If there is a log file ("nvim-pack.log" at "log" |stdpath()|), open it
+--- and navigate to latest updates (at the bottom). Locate lines about plugin
+--- update details and use revision from "State before".
+---- Freeze plugin to target revision (set `version` and |:restart|).
+---- Run `vim.pack.update({ 'plugin-name' }, { force = true })` to make plugin
+--- state on disk follow target revision. |:restart|.
+---- When ready to deal with updating plugin, unfreeze it.
+---
---Remove plugins from disk:
---- Use |vim.pack.del()| with a list of plugin names to remove. Make sure their specs
---are not included in |vim.pack.add()| call in 'init.lua' or they will be reinstalled.