catppuccin / nvim

🍨 Soothing pastel theme for (Neo)vim
MIT License
5.36k stars 236 forks source link

Updating with vim-plug fails #741

Open spapanik opened 1 month ago

spapanik commented 1 month ago

Description

catppuccin fails to update with vim-plug, as vim-plug tries to do a git pull. git pull fails because catppuccin tries to pull the tags, but stable is already exists and points to a different commit

    From https://github.com/catppuccin/nvim
     - [deleted]         (none)     -> origin/release-please--branches--main--components--catppuccin
    remote: Enumerating objects: 107, done.        
    remote: Counting objects: 100% (103/103), done.        
    remote: Compressing objects: 100% (15/15), done.        
    remote: Total 22 (delta 13), reused 11 (delta 6), pack-reused 0        
       0b5df9c..10eda02  main       -> origin/main
     ! [rejected]        stable     -> stable  (would clobber existing tag)
     * [new tag]         v1.8.0     -> v1.8.0```

### Neovim version

```markdown
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1720049189

Terminal and multiplexer

konsole 24.05.2

Catppuccin version / branch / rev

only affects updates, not a specific version/branch/rev

Steps to reproduce

:PlugUpdate when there is an older version installed

Expected behavior

:PlugUpdate should update catppuccin

Actual behavior

Update fails with:

    From https://github.com/catppuccin/nvim
     - [deleted]         (none)     -> origin/release-please--branches--main--components--catppuccin
    remote: Enumerating objects: 107, done.        
    remote: Counting objects: 100% (103/103), done.        
    remote: Compressing objects: 100% (15/15), done.        
    remote: Total 22 (delta 13), reused 11 (delta 6), pack-reused 0        
       0b5df9c..10eda02  main       -> origin/main
     ! [rejected]        stable     -> stable  (would clobber existing tag)
     * [new tag]         v1.8.0     -> v1.8.0```

### Repro

```Lua
-- DO NOT change the paths and don't remove the colorscheme
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", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "catppuccin/nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("catppuccin")
-- add anything else here
vollowx commented 1 month ago

As I can see, both stable and 1.8.0 tags point to the same commit, and the given repro file uses lazy.nvim so I can't reproduce the issue. Can you try to remove the local directory of catppuccin/nvim and do :PlugInstall again?

spapanik commented 1 month ago

This works indeed, this is my current workaround. It asked vim plug to allow doing a git pull --force (with a config option) but it was rejected.

vollowx commented 1 month ago

I'm not familiar with vim-plug so I think we can leave this issue open until the next release, and check if the same thing happens.

vollowx commented 1 month ago

@spapanik As version 1.9.0 is released, is this issue happening again?