Allow pull with --force
As there are plugins that clobber the latest or stable or similar tags, they fail at update (for example catppuccin/nvim). The solution is for me to go to ~/.local/share/nvim/plugged/, find the offending plugin, and do a git pull --force. I was wondering if there is the option to do it from :PlugUpdate, and if not I would like to make a feature request for this.
" Main plugins
Plug 'dense-analysis/ale'
Plug 'jiangmiao/auto-pairs'
Plug 'jlanzarotta/bufexplorer'
Plug 'catppuccin/nvim', {'as': 'catppuccin'}
Plug 'github/copilot.vim'
Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
Plug 'bogado/file-line'
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --bin'}
Plug 'jparise/vim-graphql'
Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}
Plug 'preservim/nerdtree'
Plug 'lambdalisue/suda.vim'
Plug 'ervandew/supertab'
Plug 'leafgarland/typescript-vim'
Plug 'SirVer/ultisnips'
Plug 'vim-airline/vim-airline'
Plug 'moll/vim-bbye'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'hynek/vim-python-pep8-indent'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-speeddating'
Plug 'cespare/vim-toml'
Plug 'editorconfig/editorconfig-vim'
Plug 'zah/nim.vim'
" Plugin extras
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline-themes'
Plug 'honza/vim-snippets'
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1713773202
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
- Type:
- [ ] Bug
- [ ] Enhancement
- [x] Feature Request
- [x] Question
- OS:
- [x] All/Other
- [ ] Linux
- [ ] macOS
- [ ] Windows
- Vim:
- [ ] Terminal Vim
- [ ] GVim
- [x] Neovim
As there are plugins that clobber the
latestorstableor similar tags, they fail at update (for examplecatppuccin/nvim).
It's not clear why they fail to update. Can you be more specific? You're not specifying the tag in the Plug command, so they shouldn't affect the git pull process.
My global git configuration automatically pulls and prunes tags, which is the configuration that makes sense for the repos that I'm working with.
I found an installation that I haven't manually force pulled catpuccin. This is the error I'm getting:
x catppuccin:
From https://github.com/catppuccin/nvim
! [rejected] stable -> stable (would clobber existing tag)
When I go to ~/.local/share/nvim/plugged/catppuccin and I delete the offending tag, it updates fine.
My global git configuration automatically pulls and prunes tags
Can you show me the config?
The two parts in the config are:
[remote "origin"]
tagOpt = --tags
[fetch]
pruneTags = true
Thanks for the clarification. I think this is a very rare case; an unorthodox use of tags (they should be maintaining stable branch instead) combined with a non-default global git option of yours.
vim-plug has been extremely stable and is not expected to change much in the near future, so I suggest that you add --force to your local copy of plug.vim, instead we add an option that few people will use.
fwiw, I'm having the same problem and my solution was to add a hook ['do'] = 'git config fetch.pruneTags false' so that I don't need to modify plug/the repo every time i set up (which is ok for repositories that do that as long as you don't need some specific tag).