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

Failed to compare with the origin when PlugClean. #1283

Closed
4 of 11 tasks
Davtrap21 opened this issue Jun 16, 2024 · 7 comments
Closed
4 of 11 tasks

Failed to compare with the origin when PlugClean. #1283

Davtrap21 opened this issue Jun 16, 2024 · 7 comments

Comments

@Davtrap21
Copy link

Davtrap21 commented Jun 16, 2024

Hi, every time I try to PlugClean it prompts me to delete the directories of every single installed plugin, not only the ones missing from the list, and the message:

Failed to compare with the origin. The default branch might have changed.

I tried to fix everything I knew I changed in my hand to see if I broke the manager; folder sharing, outdated git, vim-plug or NeoVim, firewall rules, VPN...

I use a .vim file for vim-plug only, and init.lua for configs, setups and to source the vim file. Although I thought that could be an issue, I have a similar if not the same setup in a laptop with the same OS, and the old git, NeoVim and vim-plug versions I had in my main computer. PlugClean works perfectly there.

I've been trying to solve it on my own for some time but now but I finally ran out of ideas, I don't know if I screwed the manager up or if this is a bug, what am I missing?

Additional note

I kept the same versions for git and NeoVim since the problem started, I never updated till the day of this issue writing.
The only I think I updated was vim-plug.
Old versions were 0.9.5 release for NeoVim and 2.35.X.windows.2 for git.
New version of NeoVim is listed below (:version), new git version is 2.45.2.windows.1.

Thought this might be important.


call plug#begin()

Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'ellisonleao/gruvbox.nvim'
Plug 'Mofiqul/vscode.nvim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'mfussenegger/nvim-jdtls'
Plug 'neovim/nvim-lspconfig'
Plug 'joshdick/onedark.vim'
Plug 'catppuccin/nvim', { 'as': 'catppuccin' }
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-fugitive'
" Plug 'nvim-java/nvim-java'
" Plug 'mfussenegger/nvim-dap'
Plug 'Djancyp/better-comments.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-lua/plenary.nvim'
Plug 'jxm35/livecode.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.6' }
Plug 'Decodetalkers/csharpls-extended-lsp.nvim'
Plug 'jakobkhansen/journal.nvim'

call plug#end()
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
  • Type:
    • Bug
    • Enhancement
    • Feature Request
    • Question
  • OS:
    • All/Other
    • Linux
    • macOS
    • Windows
  • Vim:
    • Terminal Vim
    • GVim
    • Neovim
@junegunn
Copy link
Owner

Can you test this command in one of the plugin's directory? (e.g. :echo g:plugs['coc.nvim'].dir)

git rev-list --count --left-right HEAD...origin/master

# or this if the default branch is main
git rev-list --count --left-right HEAD...origin/main

@Davtrap21
Copy link
Author

Command output in coc directory:

PS C:/.../nvim-data/plugged/coc.nvim> git rev-list --count --left-right HEAD...origin/master
1	1

@junegunn
Copy link
Owner

The output looks fine. Can you test it again inside Vim like so?

:execute 'cd' g:plugs['coc.nvim'].dir | echo system('git rev-list --count --left-right HEAD...origin/master') | echo v:shell_error

@Davtrap21
Copy link
Author

Davtrap21 commented Jun 17, 2024

Output is:

C:\Users\USER\AppData\Local\nvim-data\plugged\coc.nvim
1       1
0

@junegunn
Copy link
Owner

junegunn commented Jun 18, 2024

My guess is that you're using an old version of powershell as your &shell, right?

Can you check if b98b662 fixes the problem?

FWIW, I had to follow the guide in :help shell-powershell to make :PlugDiff work, but without Remove-Alias because it's not available on powershell 5.

@Davtrap21
Copy link
Author

I was using powershell 5.1.

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  4046

b98b662 solved the issue, no more failed messages and finally only prints plugins not in list, thank you very much for your help and fast responses, really appreciate it a lot!

@junegunn
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants