junegunn / vim-plug

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

Fix PlugClean error when the default branch has changed #1269

Closed junegunn closed 4 months ago

junegunn commented 4 months ago

Fix #1253

junegunn commented 4 months ago

I was able to trigger the code by removing .git/refs/heads/master.

x vim-xxx:
    Failed to compare with the origin. The default branch might have changed.
    PlugClean required.
junegunn commented 4 months ago

See #1005 for the discussion on automatic update of the default branch.

adamency commented 3 months ago

@junegunn Hi. I have read the threads, #1005 and #1272, but this fails to answer my question.

Can you please clarify this error message ?

"Failed to compare with the origin. The default branch might have changed.\nPlugClean required."

As per your own documentation:

`PlugClean[!]`                       | Remove unlisted plugins (bang version will clean without prompt)

but your error message tells about using PlugClean in the context of installed plugins, so either your code has changed and PlugClean is doing something else/more now, or your error message is wrong or missing some explanation.

Basically, my comment boils down to the fact that I was running PlugStatus to check the status of my plugins after the update of vim-plug itself via PlugUpgrade (which was supposed to solve the default branch issue), when I got this error message for all my installed plugins. However I do not want to remove the unlisted plugins from the filesystem and I still want to correct the PlugStatus.

Please provide information to better understand the issue and solve it.

junegunn commented 3 months ago

@adamency

when I got this error message for all my installed plugins.

All plugins? That doesn't sound right. Please open a new issue explaining the problem, with the plug section of your Vim configuration, screenshots, git --version, etc.