I am using set_handler to create a handler that will execute on every plugin regardless of key.
Example:
local data = {
["telescope.nvim"] = { commit = "6bddc38c25af7b50f99cb0c035248d7272971810", date = "2022-07-16T09:56:33+02:00"},
}
local packer = require('packer')
packer.set_handler(1, function(_, plugin, _)
local name = plugin.short_name
if data[name] then
plugin.commit = data[name].commit
end
end)
packer.init()
packer.use("nvim-telescope/telescope.nvim")
This handler does not take effect before the plugin type is setup. This means that the install_cmd does not see the commit update and sets --depth to 1 for the install command. When packer then goes to install it does see the commit change and tries to checkout the commit hash. Since the setup make the depth 1 that commit will not exist and fail to install.
There are two solutions I have thought of:
Apply handlers before calling the plugin_type setup here
set_handler(1, ...) might be the unintended. If so then create a similar construct for overall handler
Steps to reproduce
Copy the example data and handler lines from example before your packer init/setup
Delete your local telescope folder from your packer install location
PackerInstall
Actual behaviour
Failed to install telescope at commit hash with a reference is not a tree.
nvim --version
: v0.8.0-devgit --version
: 2.36.1I am using
set_handler
to create a handler that will execute on every plugin regardless of key.Example:
This handler does not take effect before the plugin type is setup. This means that the install_cmd does not see the commit update and sets
--depth
to1
for the install command. When packer then goes to install it does see the commit change and tries to checkout the commit hash. Since the setup make the depth 1 that commit will not exist and fail to install.There are two solutions I have thought of:
set_handler(1, ...)
might be the unintended. If so then create a similar construct for overall handlerSteps to reproduce
PackerInstall
Actual behaviour
Failed to install telescope at commit hash with a
reference is not a tree
.Expected behaviour
Installed with correct commit hash