docspack): mention re-install after source's default branch change #37560

Problem: `vim.pack.update()` doesn't update source's default branch if
  it has changed on the remote. It can be done by executing
  `git remote set-head origin --auto` for every plugin on every update,
  but it feels like too much extra work (which requires Internet
  connection) for a very rare use case.

  This matters since `version = nil` will keep pointing to previous
  default branch even after `vim.pack.update()`.

Solution: Document that in order for `version = nil` to point to the
  source's new default branch, perform clean re-install.
This commit is contained in:
Evgeni Chasnovski
2026-01-26 15:20:33 +02:00
committed by GitHub
parent d6a6078809
commit e6d955cb2c
2 changed files with 6 additions and 0 deletions

View File

@@ -1210,6 +1210,9 @@ end
---
--- Notes:
--- - Every actual update is logged in "nvim-pack.log" file inside "log" |stdpath()|.
--- - It doesn't update source's default branch if it has changed (like from `master` to `main`).
--- To have `version = nil` point to a new default branch, re-install the plugin
--- (|vim.pack.del()| + |vim.pack.add()|).
---
--- @param names? string[] List of plugin names to update. Must be managed
--- by |vim.pack|, not necessarily already added to current session.