Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting branches does not work and :Lazy log looks broken. #117

Closed
matu3ba opened this issue Dec 22, 2022 · 9 comments
Closed

Setting branches does not work and :Lazy log looks broken. #117

matu3ba opened this issue Dec 22, 2022 · 9 comments
Labels
invalid This doesn't seem right

Comments

@matu3ba
Copy link

matu3ba commented Dec 22, 2022

Describe the bug
I get a bunch of

    ● cmp-cmdline 0.26ms  start
      │ Fatal: Could not find remote reference refs/heads/master.

even though I have set { 'hrsh7th/cmp-cmdline', branch = 'main' }, inside my plugins.lua file.

Which version of Neovim are you using?
Gui(specify which GUI client you are using)? Nightly? Version? NVIM v0.9.0-dev-546+g98daaa798

To Reproduce
Make sure to read https://github.com/folke/lazy.nvim/wiki/Minimal-%60init.lua%60-to-Reproduce-an-Issue
The reproduction script should contain instructions how to create a file from verbatim string for the used plugins.

A minimal config is:

return {
  { 'hrsh7th/cmp-cmdline', branch = 'main' },
}

and init.lua

-- git clone --filter=blob:none --single-branch https://github.com/folke/lazy.nvim.git $HOME/.local/share/nvim//lazy/lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local has_lazy = vim.loop.fs_stat(lazypath)
if not has_lazy then
  print 'Please install lazy, instructions in init.lua'
else
  vim.opt.runtimepath:prepend(lazypath)
  require("lazy").setup("my_plugins", {})
end

Steps to reproduce the behavior:

  1. Run :Lazy sync

Expected Behavior
Correct cloning or git fetch + git merge --ff-only.

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot_20221223_005058

Log
:Lazy log execution fails with the following error:

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/view/text.lua:89: end_col val
ue outside range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/view/text.lua:89: in function 'render'
        ...local/share/nvim/lazy/lazy.nvim/lua/lazy/view/render.lua:73: in function 'update'
        .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/view/init.lua:129: in function <.../.local/share/nvim/lazy/lazy.
nvim/lua/lazy/view/init.lua:126>
@matu3ba matu3ba added the bug Something isn't working label Dec 22, 2022
@matu3ba
Copy link
Author

matu3ba commented Dec 22, 2022

Sidenode: github has predefined text areas for filling multiple windows: https://github.com/ziglang/zig/issues/new?assignees=&labels=error+message&template=error_message.yml

Other observation: I dont see many tests. Might be useful to add a procedure to collect them. For example I could not spot tests for branch.

@olimorris
Copy link

Just came to report :Lazy log being broken. I'm seeing the same thing

@folke
Copy link
Owner

folke commented Dec 23, 2022

I can't reproduce this with the below:

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",
  -- add any other pugins here
  "hrsh7th/nvim-cmp",
  { "hrsh7th/cmp-cmdline", branch = "main" },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

@folke
Copy link
Owner

folke commented Dec 23, 2022

@olimorris I just added some extra details to the error message about extmarks. Would be great if you could update and post back the error message you got

@olimorris
Copy link

Yeah I'm still getting an error. If I happen to be in the README.md file from my dotfiles, with the minimal config you supplied above, I get the following error message:

Failed to set extmark. Please report a bug with this info:
{
  line = { {
      hl = {
        end_col = 13,
        hl_group = "Title"
      },
      str = ""
    }, {
      hl = {
        end_col = 12,
        hl_group = "Italic"
      },
      str = ""
    }, {
      hl = {
        end_col = 22,
        hl_group = "@text.literal.markdown_inline"
      },
      str = ""
    }, {
      hl = {
        end_col = 36,
        hl_group = "@text.literal.markdown_inline"
      },
      str = ""
    }, {
      hl = {
        end_col = 49,
        hl_group = "@text.literal.markdown_inline"
      },
      str = ""
    }, <1>{
      hl = {
        end_col = 106,
        hl_group = "@text.literal.markdown_inline"
      },
      str = ""
    }, {
      hl = "Comment",
      str = " (11 hours ago)"
    } },
  segment = <table 1>
}

Additional Info:

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"
{
  machine = "arm64",
  release = "22.1.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000"
}

@olimorris
Copy link

@folke latest commit has fixed the log issue 👍🏼

@folke
Copy link
Owner

folke commented Dec 23, 2022

@matu3ba the error you're getting is from git fetch. We do not supply a branch there. We also never do a fallback to master, so that should not be possible.

I suspect a bad internet connection made the initial clone/checkout fail?

Closing this. Doesn't seem right

@folke folke closed this as completed Dec 23, 2022
@folke folke added invalid This doesn't seem right and removed bug Something isn't working labels Dec 23, 2022
@matu3ba
Copy link
Author

matu3ba commented Dec 23, 2022

@folke Some weird cache issue.

rm -fr $HOME/.cache/nvim/lazy
rm -fr $HOME/.local/share/nvim/lazy
rm -fr $HOME/.local/share/nvim/size/pack

solved my problems.
I suspect not adding the branch tag for repos that need it on cloning breaks things, but cleaning everything sounds simpler to me.

@folke
Copy link
Owner

folke commented Dec 23, 2022

you dont need to specify a branch at all

matu3ba added a commit to matu3ba/dotfiles that referenced this issue Dec 23, 2022
waiting for folke/lazy.nvim#117
on where to put tests etc.

then proceed moving config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants