lewis6991 / pckr.nvim

Spiritual successor of https://github.com/wbthomason/packer.nvim
MIT License
251 stars 13 forks source link

Latest nvim-treesitter update throws git error #20

Closed adigitoleo closed 4 months ago

adigitoleo commented 4 months ago

The latest nvim-treesitter update (HEAD) which is pulling this commit completes successfully but throws:

 ✗ nvim-treesitter: failed to update
   fatal: ambiguous argument 'a80fe081b4c5890980561e0de2458f64aaffbfc7...nil': unknown revision or path not in the working tree.
   Use '--' to separate paths from revisions, like this:
   'git <command> [<revision>...] -- [<file>...]'
  1. Add nvim-treesitter using this pckr manifest:
require("pckr").add {
    { "nvim-treesitter/nvim-treesitter", cond = function(load_plugin)
        if is_executable('tree-sitter') then load_plugin() end
    end, run = ":TSUpdate" },
}
  1. Run :Pckr update while the mentioned commit is the HEAD of nvim-treesitter.

I think I've also had issues with a similar configuration for fzf before:

require("pckr").add {
    { "junegunn/fzf", run = ":call fzf#install()", cond = function(load_plugin)
        if system == "Windows_NT" or is_executable("apt") then load_plugin() end
    end },
}

which has thrown errors from fzf#update() on Linux systems where this plugin should not be loaded. Does the run function evaluate after cond is checked?

lewis6991 commented 4 months ago

Looks like there was a force push. Try removing and reinstalling

lewis6991 commented 4 months ago

Does the run function evaluate after cond is checked?

Yes run is run whenever the plugin is installed or updated.

adigitoleo commented 4 months ago

OK so long as the order of cond and run is as expected, then that's fine. I guess there could be some error reporting to wrap this stuff but I'll keep monitoring what kind of errors I get and make some mental notes of where I'd like improvements. Then if I get a chance I can maybe tackle that in a PR later, once this plugin has matured a bit. Thanks for the responsive maintenance.