junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.7k stars 1.9k forks source link

Allow pull with --force #1279

Open spapanik opened 3 months ago

spapanik commented 3 months ago

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"
junegunn commented 2 months ago

As there are plugins that clobber the latest or stable or similar tags, they fail at update (for example catppuccin/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.

spapanik commented 2 months ago

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.

junegunn commented 1 month ago

My global git configuration automatically pulls and prunes tags

Can you show me the config?

spapanik commented 1 month ago

The two parts in the config are:

[remote "origin"]
    tagOpt = --tags
[fetch]
    pruneTags = true
junegunn commented 1 month ago

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.