mirror of
https://github.com/neovim/neovim.git
synced 2026-04-14 03:26:10 +00:00
Problem: Commands that rely on Git may need its version to perform more
targeted actions (like decide which arguments are safe to use).
For performance, computing this version is delayed up until it is
needed (like to not compute on regular startup), but not done before
every Git operation (as it is too much and can be done better).
This requires storing the Git version in a variable which is currently
initiated via `vim.version.parse()` call (most probably because it was
easier to handle Lua types this way).
However, the problem is that this results in sourcing `vim.version`
and computing `vim.version.parse` on every startup even if no Git
operation would be done.
Solution: Don't call `vim.version.parse()` during `require('vim.pack')`
and ensure its more precise lazy computation.